php中单引号与双引号的区别

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>单引号和双引号的区别</title>
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
body {
	margin-left: 10px;
	margin-top: 10px;
	margin-right: 10px;
	margin-bottom: 10px;
}
-->
</style></head>
<body>
<div align="center">
<?php
	$i = '只会看到一遍';			//声明一个字符串变量
	echo "$i";							//输出变量内容 只会看到一遍
	echo "<p>";							//输出段标记
	echo '$i';							//输出字符 $i
?>

</div>
</body>
</html>

  

posted @ 2016-04-09 11:05  长马脸  阅读(158)  评论(0)    收藏  举报