To embed a single quote in a singly quoted string, escape it with a backslash : String Escape « String « PHP






To embed a single quote in a singly quoted string, escape it with a backslash

<?

$singly_quoted = 'This quote mark\'s no big deal either';

echo ($singly_quoted);
?>

           
       








Related examples in the same category

1.addslashes(): escapes quotes, double quotes, backslashes, and NULLs with backslashes
2.quotemeta(): escapes \ + * ? [ ^ ] ( $ )
3.String SQL command escape