Save the array as a file - generally used for users to read and write configuration items and save configuration files
This script itself must have write permissions, and the target file generated must have read and execution permissions
- //Save the array as a file - user reads and writes configuration items, saves the configuration file
- //This script itself must have write permissions, and the target file generated must have read and execution permissions
- echo '
'; print_r($_SERVER); //SERVER is used here instead of the configuration array
-
- $code = var_export($_SERVER, true);
- $code = implode("r", array(' php', "return {$code};"));
- $code = str_replace(' ', "t", $code);
-
- file_put_contents('conf.php', $code);
-
Copy Code
|