您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP中echo与print区别?

2025/10/25 13:28:10发布11次查看
php中echo与print区别?
1、echo能接受n个字符串类型的参数,而print只能接收1个字符串类型的参数;
2、echo没有返回值, print有返回值,其值永远为int类型的1。
两者相同点: 
echo 和 print 都是语言结构(官方文档解释为language construct);
echo 和 print 都是用来输出字符串的;
当同时只有一个参数的时候,echo 和 print 后面的括号(parenthesis)都是可选的,即:echo ($argument1) 等价于 echo $argument1,print(argument)等价于print argument;
echo 和 print 在输出之前,都会将参数的进行转换,尝试转换为字符串类型。
推荐教程:《php》
以上就是php中echo与print区别?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product