Home  >  Article  >  Backend Development  >  Use of php return

Use of php return

WBOY
WBOYOriginal
2016-07-29 09:08:361170browse

让 Today, the technical manager suddenly asked the PHP script to write a query to judge and return the data. After the data was found, how did you return?

Because I was not packaged into a function, I felt that I could not use Return; after that, I checked it.

A personal summary: (1) return is mainly used in functions. Its main function is to return the results/resources/parameters processed by the function to the calling location

                                                                                                                                                             

                                                                                                                        , return expression // Return an expression result

                                                        c), return // Return directly, or return a null value

val) this way.

The above introduces the use of php return, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn