WordPress Support Officer Question: Download Questions PDF
<?php
$str = 'Hello, there.nHow are you?nThanks for visiting Us';
print $str;
?>
Why does not given code print the newline properly?
![WordPress Support Officer Interview Answer WordPress Support Officer Interview Question](https://globalguideline.com/public/images/interview/27.png)
Answer:
<?php
$str = 'Hello, there.nHow are you?nThanks for visiting Us';
print $str;
?>
Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters - and n.
$str = 'Hello, there.nHow are you?nThanks for visiting Us';
print $str;
?>
Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters - and n.
Download WordPress Support Officer Interview Questions And Answers
PDF