An error occurred while calling the same PHP file on the same page multiple times. when calling the same PHP file multiple times, only the results returned for the first time are correct, and all subsequent calls will report an error, how can this problem be solved? Shared to: An error occurred while calling the same PHP file on the same page multiple times.
On a page, when you call the same PHP file multiple times, only the results returned for the first time are correct, and all subsequent calls will report an error. how can this problem be solved?
Share:
------ Solution --------------------
The include_once statement contains and runs the specified file during script execution. This behavior is similar to the include statement. The only difference is that if the file has already been included, it will not be included again. As the statement name implies, it will only be included once.
We recommend that you encapsulate them into functions for repeated calls.