Home >Backend Development >PHP Tutorial >The difference between PHP double quotes and single quotes_PHP Tutorial

The difference between PHP double quotes and single quotes_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 17:41:49912browse

Variables inside single quotes will not be executed, but double quotes will.

For example,
$name = hello;
echo "the $name";
will output the hello

and if it is a single quote
$name = hello ;
echo the $name;
will output the $name

The main difference is this.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486094.htmlTechArticleVariables inside single quotes will not be executed, but double quotes will. For example, $name = hello; echo "the $name"; will output the hello, and if it is a single quote, $name = hello; echo the $name; will output...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn