3v4l.org

run code in 300+ PHP versions simultaneously
<?php $thequery = "O'Really"; $thequery = str_replace("'", "\\'", $thequery); echo $thequery;

preferences:
31.53 ms | 402 KiB | 5 Q