Home > Backend Development > PHP Tutorial > 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
Release: 2016-07-21 14:54:28
Original
1086 people have browsed it

""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. ...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template