In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to use return sentences in php". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use return sentences in php" can help you solve the problem.
1. Description
(1) return exits from the current method, returns to the statement of the calling method, and continues execution.
(2) return returns a value to the statement that calls the method, and the data type of the return value must be the same as the type of the return value in the method declaration.
(3) return can also be followed by no parameters, no parameters is to return empty, in fact, the main purpose is to interrupt the function execution and return to the calling function.
two。 Attention to use
Return parameters. It is recommended that you do not add parentheses. Because return is a language structure rather than a function, its arguments usually do not use parentheses, and in fact they should not be used, which reduces the burden on PHP.
When no parameter is returned, it must be returned without parentheses. Because when no parameter is returned, NULL is returned by default. Parsing errors can occur if you call return with parentheses but no arguments.
3. Example
In the method of jumping out of the loop, we have learned the common use, this article needs to introduce a language structure return. When we learn about other programming, generally speaking, return is used as a function, but if you put it in a php statement, you can't use the function.
This is the end of the introduction to "how to use return statements in php". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.