3v4l.org

run code in 500+ 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:  18
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        FRAMELESS_ICALL_3                str_replace         ~3      '%5B', '%3C'
          2        OP_DATA                                                      !0
          3        ASSIGN                                                       !1, ~3
    6     4        FRAMELESS_ICALL_3                str_replace         ~5      '%5D', '%3E'
          5        OP_DATA                                                      !1
          6        ASSIGN                                                       !1, ~5
    7     7        FRAMELESS_ICALL_3                str_replace         ~7      'audio', 'a'
          8        OP_DATA                                                      !1
          9        ASSIGN                                                       !1, ~7
    9    10        FRAMELESS_ICALL_3                str_replace         ~9      'mp3%3D', 'href%3D'
         11        OP_DATA                                                      !1
         12        ASSIGN                                                       !1, ~9
   12    13        FRAMELESS_ICALL_3                str_replace         ~11     '%3E%3C', '%3Elink+text%3C'
         14        OP_DATA                                                      !1
         15        ASSIGN                                                       !1, ~11
   14    16        ECHO                                                         !1
   15    17      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
229.33 ms | 2113 KiB | 13 Q