3v4l.org

run code in 300+ PHP versions simultaneously
<?php // eliminar esta etiqueta usando expresiones regulares php // https://es.stackoverflow.com/q/131277/127 $str = '<p><img src="img/something.jpg" width="1249124" height="20" alt="foo" /></p>'; $str = preg_replace('%(.*?)<p>\s*(<img[^<]+?)\s*</p>(.*)%is', '$1$2$3', $str); //Imprimir el resultado echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T4c9c
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%3Cp%3E%3Cimg+src%3D%22img%2Fsomething.jpg%22+width%3D%221249124%22+height%3D%2220%22+alt%3D%22foo%22+%2F%3E%3C%2Fp%3E'
    6     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%25%28.%2A%3F%29%3Cp%3E%5Cs%2A%28%3Cimg%5B%5E%3C%5D%2B%3F%29%5Cs%2A%3C%2Fp%3E%28.%2A%29%25is'
          3        SEND_VAL                                                 '%241%242%243'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    9     7        ECHO                                                     !0
   10     8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.02 ms | 1394 KiB | 15 Q