3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "ʪ֣ãdÅìÐÄš³·¿­ÉÁÊg¡¸Ší¿ÃÐgdÁ®›¶œ¸˜Ïg¹¥ç"; $esc = preg_replace( '~([^a-z0-9])~u','\\\$1',$str ); var_dump( $esc );
based on 1M2Zo
Output for 4.3.3 - 7.2.0
string(111) "\Ê\ª\Ö\£\ãd\Å\ì\Ð\Ä\š\³\·\¿\­\É\Á\Êg\¡\¸\Š\í\¿\Ã\Ðgd\Á\®\›\¶\œ\¸\˜\Ïg\¹\¥\ç"
Output for 4.3.0 - 4.3.2
string(112) "\Ê\ª\Ö\£\ãd\Å\ì\Ð\Ä�\�\³\·\¿\­\É\Á\Êg\¡\¸�\�\í\¿\Ã\Ðgd\Á\®�\�\�\¶�\�\¸�\�\Ïg\¹\¥\ç"