title: how to parse m3u8 and get difffrent bitttrate sub m3u8 urls?
body: <p>could any one show me how in php i can get different bitrate(resolution) sub m3u8 urls if we have the main playlist m3u8 using get_data method?The following is data i have from get_data method but i want  to get m3u8 urls for each resolution. Could any one show me how this can be done?Thanks in advance.</p>
  
  <pre><code>$returned_content = get_data(''.$m3u8Url);
  /* gets the data from a URL */
  function get_data($url) {
      $ch = curl_init();
      $timeout = 5;
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
      $data = curl_exec($ch);
      curl_close($ch);
      return $data;
  }
  </code></pre>
  
  <p>main playlist m3u8:</p>
  
  <pre><code>  #EXTM3U
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1628000,RESOLUTION=852x480,CODECS="avc1.77.30,mp4a.40.2"
      http://me.mysite.com/media/l3/ertetertyrtut34534234324f3esrere/erewewrwrtf34324343443243434344/test1.mpegts/playlist-dfasdfasdfaw4q3243241.m3u8
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=128000,RESOLUTION=256x144,CODECS="avc1.66.30,mp4a.40.2"
      http://me.mysite.com/media/l3/ertetertyrtut34534234324f3esrere/fgdhgfhgjhghfdsdf45454545345435/test1.mpegts/playlist-adfdfghgjdt5t45454542.m3u8
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=464000,RESOLUTION=426x240,CODECS="avc1.77.30,mp4a.40.2"
      http://me.mysite.com/media/l3/ertetertyrtut34534234324f3esrere/764563564565445fsdf4r3dfdfdffdf/test1.mpegts/playlist-eertyeryry564534rrtr3.m3u8
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=828000,RESOLUTION=640x360,CODECS="avc1.77.30,mp4a.40.2"
      http://me.mysite.com/media/l3/ertetertyrtut34534234324f3esrere/fgsfdgdfgfdg5435345456745264554/test1.mpegts/playlist-fgsfghdghjt4353454544.m3u8
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2128000,RESOLUTION=1024x576,CODECS="avc1.77.30,mp4a.40.2"
      http://me.mysite.com/media/l3/ertetertyrtut34534234324f3esrere/sfdgsdfgfdgfdgfdgfd465436546576/test1.mpegts/playlist-fghdjhygjujdfgsaf4455.m3u8
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3692000,RESOLUTION=1280x720,CODECS="avc1.64001f,mp4a.40.2"
      http://me.mysite.com/media/l3/ertetertyrtut34534234324f3esrere/sfdghgjyuktyurty546565466453645/test1.mpegts/playlist-safdghhgfjjyj45345546.m3u8
  </code></pre>