3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '""COMERI"" SANATORIO COOP. MEDICA'; $b = 'CABA├â?A ""LA CACHIMBA"" DE INES BO'; function clean($string) { //$string = str_replace('"', ' ', $string); // Replaces all spaces with hyphens. //return str_replace('"', ' ', $string); // Replaces all spaces with hyphens. return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. } function decodeTildes($cadena) { return str_replace(array('&aacute;', '&eacute;', '&iacute;', '&oacute;', '&uacute;', '&ntilde;', '&Aacute;', '&Eacute;', '&Iacute;', '&Oacute;', '&Uacute;', '&Ntilde;', '&deg;', '&quot;'), array('á', 'é', 'í', 'ó', 'ú', 'ñ', 'Á', 'É', 'Í', 'Ó', 'Ú', 'Ñ', '°', '"'), $cadena); } /*echo $a; echo "\n"; echo htmlspecialchars_decode($a); */ echo $b; echo "\n"; echo clean($b); echo "\n"; echo decodeTildes($b); echo "\n"; echo decodeTildes(clean($b)); //echo decodeTildes($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vQ6ZO
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%22%22COMERI%22%22+SANATORIO+COOP.+MEDICA'
    4     1        ASSIGN                                                   !1, 'CABA%E2%94%9C%C3%A2%3FA+%22%22LA+CACHIMBA%22%22+DE+INES+BO'
   17     2        ECHO                                                     !1
   18     3        ECHO                                                     '%0A'
   19     4        INIT_FCALL                                               'clean'
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
   20     8        ECHO                                                     '%0A'
   21     9        INIT_FCALL                                               'decodetildes'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $5      
         12        ECHO                                                     $5
   22    13        ECHO                                                     '%0A'
   23    14        INIT_FCALL                                               'decodetildes'
         15        INIT_FCALL                                               'clean'
         16        SEND_VAR                                                 !1
         17        DO_FCALL                                      0  $6      
         18        SEND_VAR                                                 $6
         19        DO_FCALL                                      0  $7      
         20        ECHO                                                     $7
   24    21      > RETURN                                                   1

Function clean:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vQ6ZO
function name:  clean
number of ops:  8
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%5EA-Za-z0-9%5C-%5D%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    9     7*     > RETURN                                                   null

End of function clean

Function decodetildes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vQ6ZO
function name:  decodeTildes
number of ops:  8
compiled vars:  !0 = $cadena
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 <array>
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
   12     7*     > RETURN                                                   null

End of function decodetildes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.48 ms | 1403 KiB | 21 Q