3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='This is a space after a <br> break. This is 2 spaces after a <br> break. This is a tab after a <br> break. This is a newline after a <br> break'; var_export(str_replace(['<br> ','<br /> '],['<br>','<br />'],$string)); // if you KNOW there is only one space echo "\n\n"; var_export(preg_replace('~<br(?: /)?>\K\s+~i','',$string)); // if you want to remove all spaces, tabs, newlines
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8uBa4
function name:  (null)
number of ops:  19
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'This+is+a+space+after+a+%3Cbr%3E+break.%0AThis+is+2+spaces+after+a+%3Cbr%3E++break.%0AThis+is+a+tab+after+a+%3Cbr%3E++break.%0AThis+is+a+newline+after+a+%3Cbr%3E%0Abreak'
    8     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 <array>
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   10     9        ECHO                                                     '%0A%0A'
   12    10        INIT_FCALL                                               'var_export'
         11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%7E%3Cbr%28%3F%3A+%2F%29%3F%3E%5CK%5Cs%2B%7Ei'
         13        SEND_VAL                                                 ''
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.09 ms | 999 KiB | 16 Q