ADDCSlashes (Php 4, Php 5, Php 7, Php 8)
<?php
echo addcslashes('foo[ ]', 'A..z');
// output: \f\o\o\[ \]
// All upper and lower-case letters will be escaped
// ... but so will the [\]^_`
?>
SAMER SAEID