Print the newline

Why doesn't the given code print the newline correctly?

$str = ‘Hello, there.nHow are you?nThanks for visiting Us';

print $str;

?>

 

E

Expert

Verified

Since inside the single quotes the n character is not interpreted as newline, only like a sequence of two characters – and n. Given code doesn’t print the newline correctly.

   Related Questions in Science

©TutorsGlobe All rights reserved 2022-2023.