Blogger Information
Blog 6
fans 0
comment 0
visits 5363
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP中echo的单引号和双引号的区别
武文俊的博客
Original
904 people have browsed it

如果把字符串常量和变量一起输出的话,必须使用双引号,双引号能识别字符串中的变量。

而单引号会把它包含的内容当成一个整体的字符串常量输出。

$name = 'wangyuchun';  
$car = array('Volvo', 'Ford', 'BMW');  
  
echo 'my name is $name</br>';  
echo "my car is $car[0]</br>";


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post