Save array to file

WBOY
Release: 2016-07-25 08:47:29
Original
925 people have browsed it
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
  1. //Save the array as a file - user reads and writes configuration items, saves the configuration file
  2. //This script itself must have write permissions, and the target file generated must have read and execution permissions
  3. echo '
    '; print_r($_SERVER); //SERVER is used here instead of the configuration array
  4. $code = var_export($_SERVER, true);
  5. $code = implode("r", array('
  6. $code = str_replace(' ', "t", $code);
  7. file_put_contents('conf.php', $code);
Copy Code


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template