How to parse a config file into an array?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HugoFromBOSS
    New Member
    • Sep 2007
    • 38

    #16
    Originally posted by ronverdonk
    Do the file reading in a loop. Like this:
    [php] $fh = @fopen($url, "r");
    while (!feof($fh)) {
    $file_cfg = fgets($fh);
    list($key,$val) = split(' ', $file_cfg);
    $array[$key]=$val;

    }[/php]
    Ronald

    W00t thanks your pro :p

    Comment

    Working...