Advertisement
Danack

ini converter

Mar 13th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. $iniSettings = parse_ini_file("./basereality.php.ini");
  2.  
  3. $filehandle = fopen("./basereality.php.fpm.ini", "w");
  4.  
  5. foreach ($iniSettings as $key => $value) {
  6.  
  7. if (is_bool($value) == true ||
  8. $value === 0 ||
  9. $value === 1) {
  10.  
  11. if ($value === false) {
  12. $value = "0";
  13. }
  14.  
  15. fwrite($filehandle, "php_admin_flag[$key] = $value".PHP_EOL);
  16. }
  17. else {
  18. fwrite($filehandle, "php_admin_value[$key] = \"$value\"".PHP_EOL);
  19. }
  20. }
  21.  
  22. fclose($filehandle);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement