● date
格式化一個本地時間/日期
string date(string format[, int timestamp]);
● getdate
取得日期/時間資訊
array getdate([int timestamp]);
● microtime
返回當前Unix時間戳記和微秒數
mixed microtime([bool get_as_float]);
● date_default_timezone_set
設定預設時區
bool date_default_timezone_set(string timezone_identifier);
● date_default_timezone_get
擷取預設時區
string date_default_timezone_get(void);
三、字元函數庫
strlen
擷取字串長度
int strlen(string $str);
strtolower
字串轉換為小寫
string strtolower(string $str);
strtoupper
字串轉換為大寫
string strtoupper(string $str);
ucfirst
首字母大寫
string ucfirst(string $str);
ucwords
將每個單詞的首字母轉換為大寫字母
string ucwords(string $str);
ltrim
從字串開始的位置刪除空格或其他字元
string ltrim(string $str [, string $charlist]);
rtrim
從字串結束的位置刪除空格或者其他字元
string rtrim(string $str[, string $chirlist]);
trim
從字串開始和結束的位置刪除空格或者其他字元
str_replace
字元替換
mixed str_ireplace(mixed $search, mixed $replace, mixed $subject, [int $count]);
str_ireplace
字元替換
mixed str_ireplace(mixed $search, mixed $replace, mixed $subject, [int $count]);
md5
計算字串的MD5雜湊
string md5(string $str[, bool $raw_output=false]);
strpos
返回一個字元在另一個字元第一次出現的位置
int strpos(string haystack, mixed needle[, int offset]);