Home  >  Article  >  Backend Development  >  Example usage of single quotes and double quotes in PHP_PHP tutorial

Example usage of single quotes and double quotes in PHP_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 14:54:281045browse

""Fields enclosed in double quotes will be interpreted by the compiler and then output as HTML code.

'' The words inside the single quotes are not interpreted and are output directly.

Both single quotes and double quotes have their own uses.

The content in single quotes will not be parsed, which is more efficient.

Such as the following code:


$url='http://www.bkjia.com';

//Single quote output

$output= '$ url';

echo 'Single quote output:'.$output.'
';

//Double quote output

$output=" $url";

echo "Double quote output:".$output;

?>

The output is as follows:

Example usage of single quotes and double quotes in PHP_PHP tutorial

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/364587.htmlTechArticleFields in double quotes will be interpreted by the compiler and then output as HTML code. ''The words inside the single quotes are not interpreted and are output directly. Both single and double quotes have their uses. ...
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