3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '[audio mp3="https://abcd.com/wp-content/uploads/sites/2/2020/03/classical-demo.mp3"][/audio]'; $b = str_replace("[","<",$a); $b = str_replace("]",">",$b); $b = str_replace("audio","a",$b); // you need to replace mp3=, not mp3, as you have 2 of it $b = str_replace("mp3=","href=",$b); // optional $b = str_replace("><",">link text<",$b); echo $b;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4lcR
function name:  (null)
number of ops:  33
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Baudio+mp3%3D%22https%3A%2F%2Fabcd.com%2Fwp-content%2Fuploads%2Fsites%2F2%2F2020%2F03%2Fclassical-demo.mp3%22%5D%5B%2Faudio%5D'
    5     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%5B'
          3        SEND_VAL                                                 '%3C'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    6     7        INIT_FCALL                                               'str_replace'
          8        SEND_VAL                                                 '%5D'
          9        SEND_VAL                                                 '%3E'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !1, $5
    7    13        INIT_FCALL                                               'str_replace'
         14        SEND_VAL                                                 'audio'
         15        SEND_VAL                                                 'a'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $7      
         18        ASSIGN                                                   !1, $7
    9    19        INIT_FCALL                                               'str_replace'
         20        SEND_VAL                                                 'mp3%3D'
         21        SEND_VAL                                                 'href%3D'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $9      
         24        ASSIGN                                                   !1, $9
   12    25        INIT_FCALL                                               'str_replace'
         26        SEND_VAL                                                 '%3E%3C'
         27        SEND_VAL                                                 '%3Elink+text%3C'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $11     
         30        ASSIGN                                                   !1, $11
   14    31        ECHO                                                     !1
   15    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.77 ms | 999 KiB | 14 Q