Reputation: 78941
The is a very simple echo statement but I can't solve it?
echo '"What is your name?'";
Upvotes: 10
Views: 3433
Reputation: 483
echo "What is your name?";
This is Simply the best. No confusion No problem..:)
Upvotes: 0
Reputation: 382606
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
Upvotes: 24
Reputation: 18798
This is where your interpreter is choking:
echo '"What is your name?'";
expecting ;
not "
Upvotes: 1
Reputation: 50650
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?'";
Upvotes: 9