Can PHP include a config.php that is remote from the extranet? And get config inside the constant
Reply content:
Can PHP include a config.php that is remote from the extranet? And get config inside the constant
If I could do it directly, the network would be really unsafe.
The include can contain remote, but the code of the remote config.php file must not be able to get it, because it will be parsed out, you can get only the content after parsing output. You might as well just curl up and pull the remote JSON file and parse it to get the value.
OK
Better with ReadFile ()
http://php.net/manual/zh/function.include.php
Good dangerous idea use API ideas
Are you afraid of being dark enough for you? It's too dangerous. Use the API or RPC-like scenarios.
To see if the remote server can parse PHP, if not, then the remote server will access the original content of the file, if so, the parsed HTML content is returned.
Contains remote files very unsafe recommended API