3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tools = "<p>tools :<br> 1 Hex Key (or two Hex key)<br> 1 screww drivers<br> 1 hammer <br> 1 drill </p>"; $search = ['<p>','</p>','<br>', 'tools :']; //Add more words to be removed $filteredStr = str_replace($search, '',$tools); $res = explode(PHP_EOL,$filteredStr); array_shift($res); // Removing empty element at the beginning of array print_r($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v52EY
function name:  (null)
number of ops:  20
compiled vars:  !0 = $tools, !1 = $search, !2 = $filteredStr, !3 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cp%3Etools+%3A%3Cbr%3E%0A++1+Hex+Key+%28or+two+Hex+key%29%3Cbr%3E%0A++1+screww+drivers%3Cbr%3E%0A++1+hammer+%3Cbr%3E%0A++1+drill+%3C%2Fp%3E'
    7     1        ASSIGN                                                   !1, <array>
    8     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
    9     8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%0A'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !3, $8
   10    13        INIT_FCALL                                               'array_shift'
         14        SEND_REF                                                 !3
         15        DO_ICALL                                                 
   11    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.75 ms | 1008 KiB | 17 Q