Home > Backend Development > PHP Tutorial > php single quotes double quotes

php single quotes double quotes

巴扎黑
Release: 2016-11-29 09:42:25
Original
1337 people have browsed it

 $b = '110';  
$type = gettype($b);  
echo '333'."$type\n";  
echo '333'.'$type\\';
Copy after login

输出 

Php代码  

333string  

333$type\  


1.双引号 里的东西 输入的时候能判断是否 包含 变量,如果包含 变量 就一起输出 

2.单引号里的就不一样,不判断是否有变量,就全部当成 字符串 输出 

3.单引号解析的时间比双引号快 

4.单引号支持\转义符,双引号支持的转义符多


Related labels:
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