Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Why doesn't the following code print the newline properly?                 $str = 'Hello, there.nHow are you?
            print $str;
    ?>
Answer:
Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters - and n.
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook