Skip to content

Instantly share code, notes, and snippets.

@riaf
Created July 31, 2009 06:18
Show Gist options
  • Select an option

  • Save riaf/159112 to your computer and use it in GitHub Desktop.

Select an option

Save riaf/159112 to your computer and use it in GitHub Desktop.
<?php
if(!function_exists('parse_ini_string')){
function parse_ini_string($ini, $process_sections=false){
$tmpfile = tempnam(sys_get_temp_dir(), 'INI');
if(@file_put_contents($tmpfile, $ini) !== false){
$r = parse_ini_file($tmpfile, $process_sections);
@unlink($tmpfile);
return $r;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment