<?php
#使用反撇號,暗示作為命令來執行
$result=`date`;
echo "<p>the server timestamp is: $result</p>";
echo "<hr color=red>";
#使用shell_exec()
$result1=shell_exec("date");
echo "<p>the server timestamp is: $result1</p>";
?>
輸出結果如下:
the server timestamp is: 當前日期: 2009/06/30 二
輸入新日期: (年月日)
the server timestamp is: 當前日期: 2009/06/30 二
輸入新日期: (年月日)
posted on 2009-06-30 15:50
期待明天 閱讀(696)
評論(0) 編輯 收藏 所屬分類:
PHP