Home  >  Article  >  Backend Development  >  php single quotes double quotes

php single quotes double quotes

巴扎黑
巴扎黑Original
2016-11-29 09:42:251284browse

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

输出 

Php代码  

333string  

333$type\  


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

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

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

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


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