print() 函数输出一个或多个字符串。
print(strings)
参数 | 描述 |
---|---|
strings | 必需。发送到输出的一个或多个字符串。 |
<?php $str = "Who's John Adams?"; print $str; print "<br />"; print $str."<br />I don't know!"; ?>
输出:
Who's John Adams? Who's John Adams? I don't know!
<?php print "This text spans multiple lines."; ?>
输出:
This text spans multiple lines.
<?php $color = "red"; print "Roses are $color"; print "<br />"; print 'Roses are $color'; ?>
输出:
Roses are red Roses are $color