3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Fuente: https://gist.github.com/gcoop/701814 function cleanse($string) { if (get_magic_quotes_gpc()) { $string = stripslashes($stringIn); } $search = array('&acirc;€“','&acirc;€œ','&acirc;€˜','&acirc;€™','&Acirc;&pound;','&Acirc;&not;','&acirc;„&cent;'); $replace = array('-','&ldquo;','&lsquo;','&rsquo;','&pound;','&not;','&#8482;'); $string = str_replace($search, $replace, $string); $string = str_replace('&acirc;€', '&rdquo;', $string); $search = array("&#39;", "\xc3\xa2\xc2\x80\xc2\x99", "\xc3\xa2\xc2\x80\xc2\x93", "\xc3\xa2\xc2\x80\xc2\x9d", "\xc3\xa2\x3f\x3f"); $resplace = array("'", "'", ' - ', '"', "'"); $string = str_replace($search, $replace, $string); $quotes = array( "\xC2\xAB" => '"', "\xC2\xBB" => '"', "\xE2\x80\x98" => "'", "\xE2\x80\x99" => "'", "\xE2\x80\x9A" => "'", "\xE2\x80\x9B" => "'", "\xE2\x80\x9C" => '"', "\xE2\x80\x9D" => '"', "\xE2\x80\x9E" => '"', "\xE2\x80\x9F" => '"', "\xE2\x80\xB9" => "'", "\xE2\x80\xBA" => "'", "\xe2\x80\x93" => "-", "\xc2\xb0" => "°", "\xc2\xba" => "°", "\xc3\xb1" => "&#241;", "\x96" => "&#241;", "\xe2\x81\x83" => '&bull;', "\xd5" => "'" ); return strtr($string, $quotes); } echo cleanse('Preocupa el estado de salud de ‪#‎Renzo‬: "Está muy grave", señaló el abuelo del niño - Dale un "Me gusta" para darle fuerzas al ');
Output for 5.4.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Preocupa el estado de salud de ‪#‎Renzo‬: "Está muy grave", se&#241;aló el abuelo del ni&#241;o - Dale un "Me gusta" para darle fuerzas al
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.4 - 5.3.29
Notice: Undefined variable: stringIn in /in/svkhN on line 6
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: stringIn in /in/svkhN on line 6