开发者

PHP Echo syntax error with single quote or double quotes?

The is a very 开发者_JAVA技巧simple echo statement but I can't solve it?

echo '"What is your name?'";


Mismatch of single quotes, use this:

echo '"What is your name?"';

Your first enclosing character was single quote but ending one was double quote causing the problem


Incorrect:

echo '"What is your name?'";
                          ^ Unexpected character

Correct:

echo '"What is your name?';

Correct:

echo "What is your name?";

Correct:

echo 'What is your name?';

Correct:

echo '"What is your name?"';

Correct:

echo "'What is your name?'";


Your quotes are nested incorrectly.


echo "\"What is your name?\"";


This is where your interpreter is choking:

echo '"What is your name?'";

expecting ; not "


echo "What is your name?";

This is Simply the best. No confusion No problem..:)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜