Home > php教程 > php手册 > PHP中单引号与双引号实例用法

PHP中单引号与双引号实例用法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:36:59
Original
1149 people have browsed it

""双引号里面的字段会经过编译器解释,然后再当作HTML代码输出。

'' 单引号里面的不进行解释,直接输出。

单引号和双引号都有自己的用途。

单引号的内容不会被解析,效率更高。

如下面代码:


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

//单引号输出

$output= '$url';

echo '单引号输出:'.$output.'
';

//双引号输出

$output="$url";

echo "双引号输出:".$output;

?>

输出如下:

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template