php print是一种语言结构,用于输出一个或多个字符串,而print实际也不是一个函数,所以不必对它使用括号,并且在php中“print”比“echo”速度稍慢。
php print
php print是一种语言结构,用于输出一个或多个字符串。print实际不是一个函数,所以您不必对它使用括号。
例子 1
<?php $str = "Who's John Adams?"; print $str; print "<br />"; print $str."<br />I don't know!"; ?>
输出:
立即学习“PHP免费学习笔记(深入)”;
Who's John Adams? Who's John Adams? I don't know!
例子 2
<?php print "This text spans multiple lines."; ?>
输出:
立即学习“PHP免费学习笔记(深入)”;
This text spans multiple lines.
print() 函数比 echo() 速度稍慢。
以上就是php print是什么意思的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号