[php]print — 輸出字符串
官方範例
<?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\".";
// 可以在打印語句中使用變量
$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 <<<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;
?>
公告版位
礁溪溫泉套房,位於宜蘭縣礁溪國小旁,近麥當勞,離礁溪火車站、首都客運、葛瑪蘭汽車客運約5分鍾車程,礁溪溫泉套房出租,您不需要再行添購傢俱,只需要帶幾件衣服,就能輕輕鬆鬆住進礁溪溫泉套房,天天在礁溪溫泉套房洗溫泉唷!意洽:游媽媽,電話0939711360,4500~4900元/月
- May 31 Tue 2011 09:44
[php]print — 輸出字符串
close
全站熱搜
留言列表
發表留言