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..:)
精彩评论