説明
print ( string arg)
argを出力ã—ã¾ã™ã€‚æˆåŠŸã—ãŸå ´åˆã«TRUEã€å¤±æ•—ã—ãŸå ´åˆã«FALSE ã‚’è¿”ã—ã¾ã™ã€‚
print()ã¯å®Ÿéš›ã«ã¯é–¢æ•°ã§ã¯(è¨€èªžæ§‹é€ ã§ã™)ã‚りã¾
ã›ã‚“。ã“ã®ãŸã‚ã€å¼•æ•°ã‚’æ‹¬å¼§ã§æ‹¬ã‚‹å¿…è¦ã¯ã‚りã¾ã›ã‚“。
例 1print()ã®ä¾‹ <?php
print("Hello World");
print "print() also works without parentheses.";
print "This spans
multiple lines. The newlines will be
output as well";
print "This spans\nmultiple lines. The newlines will be\noutput as well.";
print "escaping characters is done \"Like this\"."
// printæ–‡ã®ä¸ã§å¤‰æ•°ã‚’使用ã™ã‚‹ã“ã¨ãŒå¯èƒ½ã§ã™ã€‚
$foo = "foobar";
$bar = "barbaz";
print "foo is $foo"; // foo is foobar
// シングルクオートを使用ã™ã‚‹ã¨å€¤ã§ã¯ãªã変数åãŒå‡ºåŠ›ã•れã¾ã™ã€‚
print 'foo is $foo'; // foo is $foo
// ä»–ã®æ–‡å—を使用ã—ãªã„å ´åˆã€å¤‰æ•°ã ã‘を出力ã™ã‚‹ã“ã¨ãŒå¯èƒ½ã§ã™ã€‚
print $foo; // foobar
print <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon no extra whitespace!
END;
?> |
|
echo()ã€printf()ã€
flush()ã‚‚å‚照下ã•ã„。