PHP Developer Question:
Download Job Interview Questions and Answers PDF
How to specify the "new line" character in Single-Quoted Strings?
![PHP Developer Interview Answer PHP Developer Interview Question](https://globalguideline.com/public/images/interview/12.png)
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.
<?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 Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Which special characters need to escape in Single-Quoted Stings? | Which special characters need to escape in Double-Quoted Stings? |