Sunday, 11 August 2013

How do I parse pls file using php? Having trouble with parse_ini_file

How do I parse pls file using php? Having trouble with parse_ini_file

I have this file:
[playlist]
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
I'd like to parse it and get only file and title. Problem is
parse_ini_file gives me bogus error. I tried normal way, like I would
parse text file but it is becoming complicated with too much trimming.
Any thoughts?

No comments:

Post a Comment