I am sending this to a function, and I want double-quotes around the value of the variable below, example $var = "New York"
(note the quotes)
$fq.=" + area:$state";
So when I echo $state I want开发者_如何转开发 double quotes around it, how can I do this?
Thanks
You can write it like this:
$fq .= " + area:\"$state\"";
The backslash escapes special characters(like newline, tabs or quotes) in double quoted strings.
$var = '"New York"';
精彩评论