3v4l.org

run code in 300+ PHP versions simultaneously
<?php function normaliza ($string){ $a = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿ'; $b = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyyby'; $string = utf8_decode($string); $string = strtr($string, utf8_decode($a), $b); $string = strtolower($string); return utf8_encode($string); } function parseStopWords($text){ $text = preg_replace('/[^a-zA-Z0-9áéíóúñÁÉÍÓÚÑ¡¿\', ]/i','',$text); $stopwords = array('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); $text = str_replace(" a ", "", $text); return $text; } echo parseStopWords(normaliza('¿Qué ha sido de nuestra niñez?'));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Function utf8_decode() is deprecated in /in/i5TMF on line 5 Deprecated: Function utf8_decode() is deprecated in /in/i5TMF on line 6 Deprecated: Function utf8_encode() is deprecated in /in/i5TMF on line 8 ¿ ha sido nuestra ninez

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.23 ms | 401 KiB | 8 Q