/**************By Jiangong SUN******************/
print和echo的区别:
1. echo可以输入多个字符串,而print不能。
<?php
print "hello"."world"; //成功
echo "hello"."world"; //成功
print "hello","world"; //失败
echo "hello","world"; //成功
?>
2. echo比print更快。
<?php
$stime = microtime(true);
print "hello"."world";
$etime = microtime(true);
$total = $etime - $stime;
echo $total.'<br/>';
$stime2 = microtime(true);
echo "hello"."world";
$etime2 = microtime(true);
$total2 = $etime2 - $stime2;
echo $total2.'<br/>';
?>
执行结果:
helloworld0.0014331340789795
helloworld0.00018310546875
看到echo比print更快。