: This article mainly introduces the use of phpreturn. For more information about PHP tutorials, see. Today, the technical manager suddenly asked me to write a php script to query and judge and return data. after finally finding the data, how can I return it?
Because I did not encapsulate the function into a function, I felt that I could not use the return; and then I queried it:
My personal summary: (1) return is mainly used in functions. its main function is to return the results, resources, and parameters of function processing to the call location.
(2)
Basic usage:
A) return expression // return an expression result
B), return (expr) // function expression
C), return // directly return, or return a null value
Note: it is best not to use return ($ val.
The above introduces the use of php return, including some content, and hope to be helpful to friends who are interested in PHP tutorials.