Basic PHP Programming Question: Download PHP PDF

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

Tweet Share WhatsApp

Answer:

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

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

This script will print:

will not work in single quoted strings.

How Many Escape Sequences Are Recognized in Single-Quoted Strings?

There are 2 escape sequences you can use in single-quoted strings:

► - Represents the back slash character.
► ' - Represents the single quote character.


Download PHP PDF Read All 139 PHP Questions
Previous QuestionNext Question
What Are the Special Characters You Need to Escape in Single-Quoted Stings?What Are the Special Characters You Need to Escape in Double-Quoted Stings?