3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument('1.0', 'UTF-8'); $teamName = 'RC Drachten'; // Ignore warnings. libxml_use_internal_errors(true); // load the string into the DOM (this is your page's HTML), see below for more info $doc->loadHTMLFile ('http://www.resultservices.nl/rugby/overview.php?Page=SENIOR&LevelID=5&CompID=816'); // since we are working with HTML fragments here, remove <!DOCTYPE $doc->removeChild($doc->firstChild); // remove <html></html> and any junk $table = $doc->getElementsByTagName('table'); //$doc->replaceChild($body->item(0), $doc->firstChild); // echo the HTML (or desired portion thereof) $schedule = $doc->saveXML($table->item(1)); // Seperate each team $teams = explode ('</tr>',$schedule); echo $teams[0]; // Html table echo $teams[2]; // Table header for ($i = 0;$i<count($teams);$i++) { // Check if this is the right team $pos = strpos($teams[$i],$teamName); if ($pos !== false) { echo $teams[$i]; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 39
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 39
Branch analysis from position: 53
Branch analysis from position: 39
Branch analysis from position: 49
filename:       /in/hsDlk
function name:  (null)
number of ops:  54
compiled vars:  !0 = $doc, !1 = $teamName, !2 = $table, !3 = $schedule, !4 = $teams, !5 = $i, !6 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $7      'DOMDocument'
          1        SEND_VAL_EX                                              '1.0'
          2        SEND_VAL_EX                                              'UTF-8'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $7
    4     5        ASSIGN                                                   !1, 'RC+Drachten'
    6     6        INIT_FCALL                                               'libxml_use_internal_errors'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                                 
    8     9        INIT_METHOD_CALL                                         !0, 'loadHTMLFile'
         10        SEND_VAL_EX                                              'http%3A%2F%2Fwww.resultservices.nl%2Frugby%2Foverview.php%3FPage%3DSENIOR%26LevelID%3D5%26CompID%3D816'
         11        DO_FCALL                                      0          
   11    12        INIT_METHOD_CALL                                         !0, 'removeChild'
         13        CHECK_FUNC_ARG                                           
         14        FETCH_OBJ_FUNC_ARG                               $13     !0, 'firstChild'
         15        SEND_FUNC_ARG                                            $13
         16        DO_FCALL                                      0          
   13    17        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
         18        SEND_VAL_EX                                              'table'
         19        DO_FCALL                                      0  $15     
         20        ASSIGN                                                   !2, $15
   17    21        INIT_METHOD_CALL                                         !0, 'saveXML'
         22        INIT_METHOD_CALL                                         !2, 'item'
         23        SEND_VAL_EX                                              1
         24        DO_FCALL                                      0  $17     
         25        SEND_VAR_NO_REF_EX                                       $17
         26        DO_FCALL                                      0  $18     
         27        ASSIGN                                                   !3, $18
   19    28        INIT_FCALL                                               'explode'
         29        SEND_VAL                                                 '%3C%2Ftr%3E'
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                         $20     
         32        ASSIGN                                                   !4, $20
   20    33        FETCH_DIM_R                                      ~22     !4, 0
         34        ECHO                                                     ~22
   21    35        FETCH_DIM_R                                      ~23     !4, 2
         36        ECHO                                                     ~23
   22    37        ASSIGN                                                   !5, 0
         38      > JMP                                                      ->50
   25    39    >   INIT_FCALL                                               'strpos'
         40        FETCH_DIM_R                                      ~25     !4, !5
         41        SEND_VAL                                                 ~25
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                         $26     
         44        ASSIGN                                                   !6, $26
   26    45        TYPE_CHECK                                  1018          !6
         46      > JMPZ                                                     ~28, ->49
   28    47    >   FETCH_DIM_R                                      ~29     !4, !5
         48        ECHO                                                     ~29
   22    49    >   PRE_INC                                                  !5
         50    >   COUNT                                            ~31     !4
         51        IS_SMALLER                                               !5, ~31
         52      > JMPNZ                                                    ~32, ->39
   32    53    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.21 ms | 1392 KiB | 19 Q