3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = fread_url('http://m.liveonlinetv247.info/sports-channels.php'); preg_match_all ("/a[\s]+[^>]*?href[\s]?=[\s\"\']+". "(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/", $var, $matches); $matches = $matches[1]; $list = array(); foreach($matches as $var) { print($var."<br>"); } // The fread_url function allows you to get a complete // page. If CURL is not installed replace the contents with // a fopen / fget loop function fread_url($url,$ref="") { if(function_exists("curl_init")){ $ch = curl_init(); $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; ". "Windows NT 5.0)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt( $ch, CURLOPT_HTTPGET, 1 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION , 1 ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION , 1 ); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_REFERER, $ref ); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); $html = curl_exec($ch); curl_close($ch); } else{ $hfile = fopen($url,"r"); if($hfile){ while(!feof($hfile)){ $html.=fgets($hfile,1024); } } } return $html; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/VI0dY
function name:  (null)
number of ops:  19
compiled vars:  !0 = $var, !1 = $matches, !2 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'fread_url'
          1        SEND_VAL_EX                                              'http%3A%2F%2Fm.liveonlinetv247.info%2Fsports-channels.php'
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !0, $3
    5     4        INIT_FCALL                                               'preg_match_all'
    6     5        SEND_VAL                                                 '%2Fa%5B%5Cs%5D%2B%5B%5E%3E%5D%2A%3Fhref%5B%5Cs%5D%3F%3D%5B%5Cs%22%5C%27%5D%2B%28.%2A%3F%29%5B%22%5C%27%5D%2B.%2A%3F%3E%28%5B%5E%3C%5D%2B%7C.%2A%3F%29%3F%3C%5C%2Fa%3E%2F'
    7     6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !1
          8        DO_ICALL                                                 
    9     9        FETCH_DIM_R                                      ~6      !1, 1
         10        ASSIGN                                                   !1, ~6
   10    11        ASSIGN                                                   !2, <array>
   12    12      > FE_RESET_R                                       $9      !1, ->17
         13    > > FE_FETCH_R                                               $9, !0, ->17
   14    14    >   CONCAT                                           ~10     !0, '%3Cbr%3E'
         15        ECHO                                                     ~10
   12    16      > JMP                                                      ->13
         17    >   FE_FREE                                                  $9
   51    18      > RETURN                                                   1

Function fread_url:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 69
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 86
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
2 jumps found. (Code = 44) Position 1 = 86, Position 2 = 76
Branch analysis from position: 86
Branch analysis from position: 76
2 jumps found. (Code = 44) Position 1 = 86, Position 2 = 76
Branch analysis from position: 86
Branch analysis from position: 76
Branch analysis from position: 86
filename:       /in/VI0dY
function name:  fread_url
number of ops:  88
compiled vars:  !0 = $url, !1 = $ref, !2 = $ch, !3 = $user_agent, !4 = $html, !5 = $hfile
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
   24     2        INIT_FCALL                                               'function_exists'
          3        SEND_VAL                                                 'curl_init'
          4        DO_ICALL                                         $6      
          5      > JMPZ                                                     $6, ->69
   25     6    >   INIT_FCALL_BY_NAME                                       'curl_init'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !2, $7
   26     9        ASSIGN                                                   !3, 'Mozilla%2F4.0+%28compatible%3B+MSIE+5.01%3B+Windows+NT+5.0%29'
   28    10        INIT_FCALL_BY_NAME                                       'curl_init'
         11        DO_FCALL                                      0  $10     
         12        ASSIGN                                                   !2, $10
   29    13        INIT_FCALL_BY_NAME                                       'curl_setopt'
         14        SEND_VAR_EX                                              !2
         15        FETCH_CONSTANT                                   ~12     'CURLOPT_USERAGENT'
         16        SEND_VAL_EX                                              ~12
         17        SEND_VAR_EX                                              !3
         18        DO_FCALL                                      0          
   30    19        INIT_FCALL_BY_NAME                                       'curl_setopt'
         20        SEND_VAR_EX                                              !2
         21        FETCH_CONSTANT                                   ~14     'CURLOPT_HTTPGET'
         22        SEND_VAL_EX                                              ~14
         23        SEND_VAL_EX                                              1
         24        DO_FCALL                                      0          
   31    25        INIT_FCALL_BY_NAME                                       'curl_setopt'
         26        SEND_VAR_EX                                              !2
         27        FETCH_CONSTANT                                   ~16     'CURLOPT_RETURNTRANSFER'
         28        SEND_VAL_EX                                              ~16
         29        SEND_VAL_EX                                              1
         30        DO_FCALL                                      0          
   32    31        INIT_FCALL_BY_NAME                                       'curl_setopt'
         32        SEND_VAR_EX                                              !2
         33        FETCH_CONSTANT                                   ~18     'CURLOPT_FOLLOWLOCATION'
         34        SEND_VAL_EX                                              ~18
         35        SEND_VAL_EX                                              1
         36        DO_FCALL                                      0          
   33    37        INIT_FCALL_BY_NAME                                       'curl_setopt'
         38        SEND_VAR_EX                                              !2
         39        FETCH_CONSTANT                                   ~20     'CURLOPT_FOLLOWLOCATION'
         40        SEND_VAL_EX                                              ~20
         41        SEND_VAL_EX                                              1
         42        DO_FCALL                                      0          
   34    43        INIT_FCALL_BY_NAME                                       'curl_setopt'
         44        SEND_VAR_EX                                              !2
         45        FETCH_CONSTANT                                   ~22     'CURLOPT_URL'
         46        SEND_VAL_EX                                              ~22
         47        SEND_VAR_EX                                              !0
         48        DO_FCALL                                      0          
   35    49        INIT_FCALL_BY_NAME                                       'curl_setopt'
         50        SEND_VAR_EX                                              !2
         51        FETCH_CONSTANT                                   ~24     'CURLOPT_REFERER'
         52        SEND_VAL_EX                                              ~24
         53        SEND_VAR_EX                                              !1
         54        DO_FCALL                                      0          
   36    55        INIT_FCALL_BY_NAME                                       'curl_setopt'
         56        SEND_VAR_EX                                              !2
         57        FETCH_CONSTANT                                   ~26     'CURLOPT_COOKIEJAR'
         58        SEND_VAL_EX                                              ~26
         59        SEND_VAL_EX                                              'cookie.txt'
         60        DO_FCALL                                      0          
   37    61        INIT_FCALL_BY_NAME                                       'curl_exec'
         62        SEND_VAR_EX                                              !2
         63        DO_FCALL                                      0  $28     
         64        ASSIGN                                                   !4, $28
   38    65        INIT_FCALL_BY_NAME                                       'curl_close'
         66        SEND_VAR_EX                                              !2
         67        DO_FCALL                                      0          
         68      > JMP                                                      ->86
   41    69    >   INIT_FCALL                                               'fopen'
         70        SEND_VAR                                                 !0
         71        SEND_VAL                                                 'r'
         72        DO_ICALL                                         $31     
         73        ASSIGN                                                   !5, $31
   42    74      > JMPZ                                                     !5, ->86
   43    75    > > JMP                                                      ->81
   44    76    >   INIT_FCALL                                               'fgets'
         77        SEND_VAR                                                 !5
         78        SEND_VAL                                                 1024
         79        DO_ICALL                                         $33     
         80        ASSIGN_OP                                     8          !4, $33
   43    81    >   INIT_FCALL                                               'feof'
         82        SEND_VAR                                                 !5
         83        DO_ICALL                                         $35     
         84        BOOL_NOT                                         ~36     $35
         85      > JMPNZ                                                    ~36, ->76
   48    86    > > RETURN                                                   !4
   49    87*     > RETURN                                                   null

End of function fread_url

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.98 ms | 1396 KiB | 23 Q