PHP 打印数据:print 语句 1 个改进

Print

print - 输出字符串

说明

print ( string $arg) : int

输出 $argprint 实际上不是函数(而是语言结构),所以可以不用圆括号包围参数列表。不会换行。

printecho 的主要区别: print 只能输出一个参数,并总是返回1。

返回值

总是返回1。

范例

<?php
print("Hello World");

print "print() also works without parentheses.";

print "This spans
multiple lines. The newlines will be
output as well";

输出结果:

Hello Worldprint() also works without parentheses.This spans
multiple lines. The newlines will be
output as well
本文为 Wiki 文章,邀您参与纠错、纰漏和优化
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!