標籤:php初學者
今日課程:PHP 3Apsara Infrastructure Management Framework礎鞏固視頻教程【燕十八】
1、動態調用函數
function addition ($a, $b){echo ($a + $b), "\n"; } $result = "addition"; $result (3,6); echo "<br />";
2、時間戳記函數
echo "<br />";//時間戳記是指1970年1月1日到現在這一瞬間經過的秒數echo time(),‘<br />‘;print_r(microtime(),‘<br />‘);//返回毫秒print_r(microtime(true));//返回微秒,可以查看程式運行需要多少時間$start = microtime(true);for ($i=1; $i < 10000; $i++) { $tmp = 133333/234;}$end = microtime(true);echo $end - $start;
3、時間戳記格式化
echo "<br />";$y=date("Y",time()); $m=date("m",time()); $d=date("d",time()); echo $y.$m.$d;
4、日期解析函數
echo "<br />";echo(date("M-d-Y",mktime(0,0,0,12,36,2001)));echo(date("M-d-Y",mktime(0,0,0,14,1,2001)));echo(date("M-d-Y",mktime(0,0,0,1,1,2001)));echo(date("M-d-Y",mktime(0,0,0,1,1,99)));
5、字串定義方式
$a = "hellow";$b = "word";echo $a,‘<br />‘,$b;echo "<br />";//heredoc nowdoc定義大段文本//三個<<<定義名,結尾定義名$c = <<<HTMLhelloword abcok now;HTML;echo $c;echo "<br />";$d = <<<‘AAA‘大大大大傻逼AAA;echo $d;echo "<br />";
最後一段代碼遇到問題,未解決。
今天學習2小時,休息,明天繼續
本文出自 “一條大大大大廢魚” 部落格,謝絕轉載!
翻身的廢魚——論PHP從入門到放棄需要多久?8