PHP的print函數(shù)_PHP教程
推薦:PHP生成隨機字符串PHP生成隨機字符串的函數(shù),下面是我在網(wǎng)上找到的2個關(guān)于PHP隨機字符串的函數(shù),希望大家喜歡。 ?php function genRandomString(len) { chars = array( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t,
PHP的print函數(shù),姑且說是函數(shù)吧啊�?梢允褂迷赑HP 4, PHP 5的環(huán)境中。
print函數(shù)的作用就是輸出一個字符串。使用方法:
int print ( string arg )
print() 是一個語言結(jié)構(gòu)而非函數(shù),因此它無法被變量函數(shù)調(diào)用。 請看下面的演示:)
<?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\".";
// You can use variables inside of a print statement
foo = "foobar";
bar = "barbaz";
print "foo is foo"; // foo is foobar
// You can also use arrays
bar = array("value" => "foo");
print "this is {bar['value']} !"; // this is foo !
// Using single quotes will print the variable name, not the value
print 'foo is foo'; // foo is foo
// If you are not using any other characters, you can just print variables
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;
?>
注意: 由于這是一個語言結(jié)構(gòu)而非函數(shù),因此它無法被變量函數(shù)調(diào)用。
分享:PHP實例:一無限分類的處理類PHP代碼:-------------------------------------------------------------------------------- ?php /* 名稱: 對分類操作的業(yè)務(wù)邏輯封裝 * 說明: 本類中引用的其它類(DB、Table、Item)均未提供,所以本類只能做個參考,不能直接應(yīng)用 * 不是本人小氣不提供其
- 相關(guān)鏈接:
- 教程說明:
PHP教程-PHP的print函數(shù)
。