欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長(zhǎng)資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          PHP時(shí)間轉(zhuǎn)換函數(shù)如何使用?

          PHP時(shí)間轉(zhuǎn)換函數(shù)如何使用?

          PHP時(shí)間轉(zhuǎn)換函數(shù)

          在PHP中時(shí)間轉(zhuǎn)換函數(shù)是“strtotime()”,該函數(shù)的作用是將任何英文文本的日期或時(shí)間描述解析為Unix時(shí)間戳,其語(yǔ)法為“strtotime(time,now)”,該函數(shù)成功則返回時(shí)間戳,否則返回FALSE。

          簡(jiǎn)單例子

          <?php echo strtotime("now"), "n"; echo strtotime("10 September 2000"), "n"; echo strtotime("+1 day"), "n"; echo strtotime("+1 week"), "n"; echo strtotime("+1 week 2 days 4 hours 2 seconds"), "n"; echo strtotime("next Thursday"), "n"; echo strtotime("last Monday"), "n"; ?>

          失敗檢查

          <?php $str = 'Not Good'; // previous to PHP 5.1.0 you would compare with -1, instead of false if (($timestamp = strtotime($str)) === false) {     echo "The string ($str) is bogus"; } else {     echo "$str == " . date('l dS of F Y h:i:s A', $timestamp); } ?>

          推薦教程:《PHP教程》

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)