title: Php Curl parsing a m3u file
body: <p>Hope you guys can help me out. I have the following .m3u file </p>
  
  <pre><code>#EXTM3U
  #EXTINF:-1 tvg-id="" tvg-name="A&amp;E" tvg-logo="" group-title="ENTRETENIMIENTO",A&amp;E
  http://nxtv.tk:8080/live/jarenas/iDKZrC56xZ/76.ts
  #EXTINF:-1 tvg-id="" tvg-name="ABC Puerto Rico" tvg-logo="" group-title="NACIONALES",ABC Puerto Rico
  http://nxtv.tk:8080/live/jarenas/iDKZrC56xZ/96.ts
  #EXTINF:-1 tvg-id="" tvg-name="Animal Planet" tvg-logo="" group-title="ENTRETENIMIENTO",Animal Planet
  http://nxtv.tk:8080/live/jarenas/iDKZrC56xZ/185.ts
  </code></pre>
  
  <p>As you can see, there is the main tag for the file
  <strong>#EXTM3U</strong> and down that start the video  information tag  <strong>(#EXTINF:-1 ...)</strong> and down that the video link entry <strong>(http:// .....)</strong></p>
  
  <p>Can you explicitly tell me how can i parse this whole file (it's a pretty large one) and save the fields in an array for example like this? <strong>videos[ ]</strong>
  and later i can acces to every video attributes lets say <strong>videos[0]['title']</strong> for getting the title for the first video? and so on with the other attributes for example <strong>videos[42]['link']</strong> and get the link to the video #42.</p>
  
  <p>I am already using curl to get the file content into a variable like this </p>
  
  <pre><code>&lt;?php
     $handler = curl_init("link to m3u file");  
     $response = curl_exec ($handler);  
     curl_close($handler); 
     echo $response;
  ?&gt;
  </code></pre>
  
  <p>What i need now is to parse the Curl response and save all the videos information into an array, where i can acces to every attribute of every video.</p>
  
  <p>I know i must use some regexp or something like that. i just dont understand how. can you please help me with some code? thank you so much.</p>