fork(6) download
  1. <?php
  2. // 1. Read your INI file into a string (here we hardcode it for the demo)
  3. $str = <<<EOF
  4. [playlist]
  5. numberofentries=4
  6. File1=http://108.61.73.119:8128
  7. Title1=(#1 - 266/1000) 181.FM - POWER 181 -=[: The Hitz Channel :]=- www.181.fm
  8. Length1=-1
  9. File2=http://108.61.73.118:8128
  10. Title2=(#2 - 318/1000) 181.FM - POWER 181 -=[: The Hitz Channel :]=- www.181.fm
  11. Length2=-1
  12. File3=http://108.61.73.117:8128
  13. Title3=(#3 - 401/1000) 181.FM - POWER 181 -=[: The Hitz Channel :]=- www.181.fm
  14. Length3=-1
  15. File4=http://198.27.79.224:9770
  16. Title4=(#4 - 27/50) 181.FM - POWER 181 -=[: The Hitz Channel :]=- www.181.fm
  17. Length4=-1
  18. Version=2
  19. EOF;
  20.  
  21. $str = preg_replace('/^(Title\d+)=(.*)$/m', '\1="\2"', $str);
  22. $array = parse_ini_string($str);
  23. print_r($array);
  24. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [numberofentries] => 4
    [File1] => http://108.61.73.119:8128
    [Title1] => (#1 - 266/1000) 181.FM - POWER 181 -=[: The Hitz Channel :]=- www.181.fm
    [Length1] => -1
    [File2] => http://108.61.73.118:8128
    [Title2] => (#2 - 318/1000) 181.FM - POWER 181 -=[: The Hitz Channel :]=- www.181.fm
    [Length2] => -1
    [File3] => http://108.61.73.117:8128
    [Title3] => (#3 - 401/1000) 181.FM - POWER 181 -=[: The Hitz Channel :]=- www.181.fm
    [Length3] => -1
    [File4] => http://198.27.79.224:9770
    [Title4] => (#4 - 27/50) 181.FM - POWER 181 -=[: The Hitz Channel :]=- www.181.fm
    [Length4] => -1
    [Version] => 2
)