How to pass double quotations in a php variable?

by ryan.murray , in category: PHP General , 10 months ago

How to pass double quotations in a php variable?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by elisha_langworth , 10 months ago

@ryan.murray 

To pass double quotations in a PHP variable, you can escape them using a backslash (). Here's an example:

1
$doubleQuotes = "Here is an example of "double quotations"";


In this example, the backslash before the double quotation marks escapes them, allowing them to be included in the string assigned to the variable.