I transferred it from C ++ and asked where the PHP initialization was? Which is the first time the program needs to read the configuration data? For example, there is a main function in C ++ that can start initialization and read the configuration table or something. Now I am using PHP to write the server. Where can I add this similar function? Thank you! ------ Solution ------------------ no program is executed in the order of code. ------ solution -------------- it is transferred from C ++. where is the PHP initialization? Which is the first time the program needs to read the configuration data?
For example, there is a main function in C ++ that can start initialization and read the configuration table or something.
Now I am using PHP to write the server. Where can I add this similar function? Thank you!
------ Solution --------------------
No
Programs are executed in the order of code appearance
------ Solution --------------------
_ Construct () cube function. Similar to main.
------ Solution --------------------
What should I initialize? Php generally gets a public configuration file, which is included by everyone.
------ Solution --------------------
The script language is like this. if you want to avoid multiple executions, you can use the data cache.
Reference:
Quote: reference:
In the same way, it is equivalent to configuring database connection information in this public configuration file at the same time, and then reading public initialization things...
This is from the code level.
However
If user A browses the WEB, this part of code will run once,
If User B browses the WEB, will this part of code run again?