Quantcast
Channel: Active questions tagged linefeed+whitespace+php - Stack Overflow
Viewing all articles
Browse latest Browse all 2

How does source code manage white space and concatenation [duplicate]

0
0

This question already has an answer here:

In the following code:

    $email_body = 
       "message from $name \n" 
       "email address $visitor_email \n"
       "\n $message";

the fourth line generates a parsing error dues to an unexpected ", but the quotes seem to be correctly paired. So why is (the final?) one in the last line "unexpected"?

I expected the result for $email_body to be:

    message from $name
    email address $visitor_email 

    $message

I've looked throught the syntax page on php.net/manual, and read the questions here on single and double quotes. I can't find any exceptions for a line feed at the beginning of a string but that seems to be what it is. Can anyone clarify?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images