INI_parse
public php v1 · immutable<?phpfunction INI_parse($filename){ if(($file = fopen($filename,"r"))) { $curtag = ""; $parse = array(); while($string = fgets($file)) { $string = str_replace(array("\r","\n"),"",$string); $len = strlen($string); $pos = strpos($string,"="); if($pos === false) { if($string{0} == "[" and $string{$len - 1} == "]") $curtag = substr($string,1,$len-2); } else $parse[$curtag][substr($string,0,$pos)] = substr($string,$pos + 1); } return $parse; } return false;}?>