参数

返回值

范例

print "This spans\nmultiple lines. The newlines will be\noutput as well.";

print "escaping characters is done \"Like this\".";

// 可以在打印语句中使用变量$foo = "foobar";$bar = "barbaz";

print "foo is $foo"; // foo is foobar

// 也可以使用数组$bar = array("value" => "foo");

print "this is {$bar['value']} !"; // this is foo !

// 使用单引号将打印变量名，而不是变量的值print 'foo is $foo'; // foo is $foo

// 如果没有使用任何其他字符，可以仅打印变量print $foo; // foobar

print <<<ENDThis uses the "here document" syntax to outputmultiple lines with $variable interpolation. Notethat the here document terminator must appear on aline with just a semicolon no extra whitespace!END;?>