3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '"¡Á É Ñ Elaskar me mandaba flores pero yo creía que eran de Fariña 7!", dijo Dominique Pestaña'; function parseStopWords($text){ $text = preg_replace('/[^a-zA-Z0-9áéíóúñÁÉÍÓÚÑ¡\', ]/i','',$text); $stopwords = array('a','ante','bajo','cabe','con','contra','de','desde','en','entre','hacia','hasta','para','por','sin','sobre','tras','el','lo','la','los','las','un','unos','una','al','del','que','es','se','y','fue'); foreach($stopwords as $w){ $text = preg_replace('/\b'.$w.'\b/i','',$text); } $text = preg_replace('/\s{2,}/i',' ',$text); return $text; } echo parseStopWords($text); die; echo preg_replace('/[\x{00ff}-\x{ffff}]/u', '*', $text); echo $text; $mystring = 'Título ú Nota ó !¡ ! áéíóúñ )()&*%#$DR GT^(%(%(*&_{|}{jjkg cde d"'; $find = array ( '#[^a-z0-99áéíóúñ\\s]#is', '#\\s#' ); $replace = array ( '', ' ' ); $mystring = preg_replace ( $find, $replace, $mystring ); echo $mystring;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/A5pap
function name:  (null)
number of ops:  24
compiled vars:  !0 = $text, !1 = $mystring, !2 = $find, !3 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%22%C2%A1%C3%81+%C3%89+%C3%91+Elaskar+me+mandaba+flores+pero+yo+cre%C3%ADa+que+eran+de+Fari%C3%B1a++7%21%22%2C+dijo+Dominique+Pesta%C3%B1a'
   17     1        INIT_FCALL                                               'parsestopwords'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $5      
          4        ECHO                                                     $5
   18     5      > EXIT                                                     
   22     6*       INIT_FCALL                                               'preg_replace'
          7*       SEND_VAL                                                 '%2F%5B%5Cx%7B00ff%7D-%5Cx%7Bffff%7D%5D%2Fu'
          8*       SEND_VAL                                                 '%2A'
          9*       SEND_VAR                                                 !0
         10*       DO_ICALL                                         $6      
         11*       ECHO                                                     $6
   23    12*       ECHO                                                     !0
   25    13*       ASSIGN                                                   !1, 'T%C3%ADtulo+%C3%BA+Nota+%C3%B3+%21%C2%A1++%21+%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1++%29%28%29%26%2A%25%23%24DR+GT%5E%28%25%28%25%28%2A%26_%7B%7C%7D%7Bjjkg+cde+d%22'
   27    14*       ASSIGN                                                   !2, <array>
   28    15*       ASSIGN                                                   !3, <array>
   30    16*       INIT_FCALL                                               'preg_replace'
         17*       SEND_VAR                                                 !2
         18*       SEND_VAR                                                 !3
         19*       SEND_VAR                                                 !1
         20*       DO_ICALL                                         $10     
         21*       ASSIGN                                                   !1, $10
   32    22*       ECHO                                                     !1
         23*     > RETURN                                                   1

Function parsestopwords:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/A5pap
function name:  parseStopWords
number of ops:  28
compiled vars:  !0 = $text, !1 = $stopwords, !2 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%5Ea-zA-Z0-9%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1%C3%81%C3%89%C3%8D%C3%93%C3%9A%C3%91%C2%A1%27%2C+%5D%2Fi'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    7     7        ASSIGN                                                   !1, <array>
    9     8      > FE_RESET_R                                       $6      !1, ->19
          9    > > FE_FETCH_R                                               $6, !2, ->19
   10    10    >   INIT_FCALL                                               'preg_replace'
         11        CONCAT                                           ~7      '%2F%5Cb', !2
         12        CONCAT                                           ~8      ~7, '%5Cb%2Fi'
         13        SEND_VAL                                                 ~8
         14        SEND_VAL                                                 ''
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $9      
         17        ASSIGN                                                   !0, $9
    9    18      > JMP                                                      ->9
         19    >   FE_FREE                                                  $6
   12    20        INIT_FCALL                                               'preg_replace'
         21        SEND_VAL                                                 '%2F%5Cs%7B2%2C%7D%2Fi'
         22        SEND_VAL                                                 '+'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $11     
         25        ASSIGN                                                   !0, $11
   14    26      > RETURN                                                   !0
   15    27*     > RETURN                                                   null

End of function parsestopwords

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.67 ms | 1403 KiB | 16 Q