"new line" Character in Single-Quoted Strings in PHP

Q

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

✍: 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.

 

Understanding PHP String Literals and Operations

⇒⇒PHP Tutorials

2016-10-13, 399👍, 0💬