Can You Specify the "new line" Character in Single-Quoted Strings

Q

Can You Specify the "new line" Character in Single-Quoted Strings? - PHP Script Tips - Understanding String Literals and Operations

✍: FYIcenter.com

A

You can not specify the "new line" character in a single-quoted string. If you don't believe, try this script:

<?php 
echo '\n will not work in single quoted strings.'; 
?>

This script will print:

\n will not work in single quoted strings.

2007-04-20, 4660👍, 0💬