fork(1) download
  1. <?php
  2.  
  3.  
  4. $resposta = 'Stream #0:0(jpn): Video: h264 ...
  5. Stream #0:1(jpn): Audio: mp3 ...
  6. Stream #0:2(por): Subtitle ...';
  7.  
  8. if (preg_match_all('/Stream\s[#](\d+:\d+)\((\w+)\):\s(\w+)[ :]+(\w+|)/i', $resposta, $output) == 0) {
  9. echo 'Nenhuma informação encontrada';
  10. } else {
  11. print_r($output);
  12. }
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => Stream #0:0(jpn): Video: h264
            [1] => Stream #0:1(jpn): Audio: mp3
            [2] => Stream #0:2(por): Subtitle 
        )

    [1] => Array
        (
            [0] => 0:0
            [1] => 0:1
            [2] => 0:2
        )

    [2] => Array
        (
            [0] => jpn
            [1] => jpn
            [2] => por
        )

    [3] => Array
        (
            [0] => Video
            [1] => Audio
            [2] => Subtitle
        )

    [4] => Array
        (
            [0] => h264
            [1] => mp3
            [2] => 
        )

)