What could I use in PHP in place of the normal ' and (without ‘ or “) symbols around something?
Example:
echo("Hello, World!")
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are 4 ways to encapsulate strings, single quotes
', double quotes", heredoc and nowdoc.Read the full php.net article here.
Heredoc
http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
Nowdoc
http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc
Escaping
If you want to use literal single or double quotes within single or double quoted strings, you have to escape them:
As Herbert noted, you don’t have to escape single quotes within a double quoted strings and you don’t have to escape double quotes within a single quoted string.
If you have to add quotes on a large scale, use the addslashes() function: