翻身的廢魚——論PHP從入門到放棄需要多久?8

來源:互聯網
上載者:User

標籤: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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.