3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dir = "../AttachFile/"; $query = mssql_query("select [gc_parent_guid] FROM [dbo].[MailAttachment] INNER JOIN [dbo].[Status] ON [MailAttachment].[gc_parent_guid] = [Status].[Mail_ID] Where [Status].[Entry No] = $view_no "); $row = mssql_fetch_array($query); $gc_parent_guid = mssql_guid_string($row['gc_parent_guid']); //echo $gc_parent_guid; // Open a directory, and read its contents if (is_dir($dir)){ // ตรวจสอบว่าเป็นDirectoryหรือไม่ if ($dh = opendir($dir)){ $i = 0; //แสดงไฟล์ทั้งหมดในโฟลเดอร์ while (($file[] = readdir($dh)) !== false){ //String ทั้งหมด ที่ต้องการค้นหา $mixedStr = $file[$i]; //คำที่จะค้นหา $searchStr = $gc_parent_guid; //แทนที่ ช่องว่างโดย %20 MOD REWRITE $LinkFile = str_replace(" ", "%20", $mixedStr); if (strpos($mixedStr, $searchStr) !== false){ // echo "<br/>"."- "."<a href= ".$dir.$LinkFile.">".$file[$i]."</a><br>"; } $i++ ; } closedir($dh); } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 62
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 62
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 29
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 51
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 29
Branch analysis from position: 59
Branch analysis from position: 29
Branch analysis from position: 51
Branch analysis from position: 62
Branch analysis from position: 62
filename:       /in/JZoAL
function name:  (null)
number of ops:  63
compiled vars:  !0 = $dir, !1 = $query, !2 = $view_no, !3 = $row, !4 = $gc_parent_guid, !5 = $dh, !6 = $i, !7 = $mixedStr, !8 = $file, !9 = $searchStr, !10 = $LinkFile
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '..%2FAttachFile%2F'
    3     1        INIT_FCALL_BY_NAME                                       'mssql_query'
          2        ROPE_INIT                                     3  ~13     'select+%5Bgc_parent_guid%5D+FROM+%5Bdbo%5D.%5BMailAttachment%5D+%0AINNER+JOIN+++%5Bdbo%5D.%5BStatus%5D+%0AON+%5BMailAttachment%5D.%5Bgc_parent_guid%5D+%3D+%5BStatus%5D.%5BMail_ID%5D%0AWhere+%5BStatus%5D.%5BEntry+No%5D+%3D+'
    6     3        ROPE_ADD                                      1  ~13     ~13, !2
          4        ROPE_END                                      2  ~12     ~13, '%0A'
          5        SEND_VAL_EX                                              ~12
          6        DO_FCALL                                      0  $15     
    3     7        ASSIGN                                                   !1, $15
    9     8        INIT_FCALL_BY_NAME                                       'mssql_fetch_array'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $17     
         11        ASSIGN                                                   !3, $17
   10    12        INIT_FCALL_BY_NAME                                       'mssql_guid_string'
         13        CHECK_FUNC_ARG                                           
         14        FETCH_DIM_FUNC_ARG                               $19     !3, 'gc_parent_guid'
         15        SEND_FUNC_ARG                                            $19
         16        DO_FCALL                                      0  $20     
         17        ASSIGN                                                   !4, $20
   14    18        INIT_FCALL                                               'is_dir'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $22     
         21      > JMPZ                                                     $22, ->62
   15    22    >   INIT_FCALL                                               'opendir'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $23     
         25        ASSIGN                                           ~24     !5, $23
         26      > JMPZ                                                     ~24, ->62
   16    27    >   ASSIGN                                                   !6, 0
   18    28      > JMP                                                      ->52
   20    29    >   FETCH_DIM_R                                      ~26     !8, !6
         30        ASSIGN                                                   !7, ~26
   22    31        ASSIGN                                                   !9, !4
   24    32        INIT_FCALL                                               'str_replace'
         33        SEND_VAL                                                 '+'
         34        SEND_VAL                                                 '%2520'
         35        SEND_VAR                                                 !7
         36        DO_ICALL                                         $29     
         37        ASSIGN                                                   !10, $29
   26    38        INIT_FCALL                                               'strpos'
         39        SEND_VAR                                                 !7
         40        SEND_VAR                                                 !9
         41        DO_ICALL                                         $31     
         42        TYPE_CHECK                                  1018          $31
         43      > JMPZ                                                     ~32, ->51
   28    44    >   CONCAT                                           ~33     '%3Cbr%2F%3E-++%3Ca+href%3D+', !0
         45        CONCAT                                           ~34     ~33, !10
         46        CONCAT                                           ~35     ~34, '%3E'
         47        FETCH_DIM_R                                      ~36     !8, !6
         48        CONCAT                                           ~37     ~35, ~36
         49        CONCAT                                           ~38     ~37, '%3C%2Fa%3E%3Cbr%3E'
         50        ECHO                                                     ~38
   30    51    >   PRE_INC                                                  !6
   18    52    >   INIT_FCALL                                               'readdir'
         53        SEND_VAR                                                 !5
         54        DO_ICALL                                         $41     
         55        ASSIGN_DIM                                       ~40     !8
         56        OP_DATA                                                  $41
         57        TYPE_CHECK                                  1018          ~40
         58      > JMPNZ                                                    ~42, ->29
   31    59    >   INIT_FCALL                                               'closedir'
         60        SEND_VAR                                                 !5
         61        DO_ICALL                                                 
   34    62    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.92 ms | 1392 KiB | 25 Q