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 >   QM_ASSIGN                                                !0
   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        QM_ASSIGN                                                !0
   9     7        ASSIGN_OBJ                                               !0
  10     8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
73.78 ms | 962 KiB | 8 Q