3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $result = "°Freen\x18 ew°\x90ɮ\xc2"; $result = preg_replace('~[\x{0000}-\x{001F}\x{007F}-\x{00a0}\x{00c2}]~u', '', $result); /* //reject overly long 2 byte sequences, as well as characters above U+10000 and replace with ? $result= preg_replace( '/[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})/S', '', $result ); */ echo $result;
Output for 5.2.0 - 7.1.0
Output for 4.3.5 - 5.1.6
°Freen ew°�ɮ�
Output for 4.3.0 - 4.3.4

Process exited with code 139.