首页 > 其他 > 详细

echo和print的区别

时间:2016-05-07 14:59:57      阅读:144      评论:0      收藏:0      [点我收藏+]

1、echo可以同时输出多个字符串;

echo ‘this‘,‘ string‘,‘ is‘," hello world\n";

2、print有返回值,但是运行速度上echo比较快;

$str=‘Hello World‘;
$a=print "This is a string $str\n";
var_dump($a);

  输出结果:

This is a string Hello World
int(1)

  如果在echo的前面加一个$a=的还就会报语法错误

echo和print的区别

原文:http://www.cnblogs.com/guanking19/p/5468235.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!