Math函數:
10個較常用標紅。
abs — 絕對值
acos — 反餘弦
acosh — 反雙曲餘弦
asin — 反正弦
asinh — 反雙曲正弦
atan2 — 兩個參數的反正切
atan — 反正切
atanh — 反雙曲正切
base_convert — 在任意進位之間轉換數字
bindec — 二進位轉換為十進位
ceil — 進一法取整
cos — 餘弦
cosh — 雙曲餘弦
decbin — 十進位轉換為二進位
dechex — 十進位轉換為十六進位
decoct — 十進位轉換為八進位
deg2rad — 將角度轉換為弧度
exp — 計算 e 的指數
expm1 — 返回 exp(number) - 1,甚至當 number 的值接近零也能計算出準確結果
floor — 捨去法取整
fmod — 返回除法的浮點數餘數
getrandmax — 顯示隨機數最大的可能值
hexdec — 十六進位轉換為十進位
hypot — 計算一直角三角形的斜邊長度
is_finite — 判斷是否為有限值
is_infinite — 判斷是否為無限值
is_nan — 判斷是否為合法數值
lcg_value — 組合線性同餘發生器
log10 — 以 10 為底的對數
log1p — 返回 log(1 + number),甚至當 number 的值接近零也能計算出準確結果
log — 自然對數
max — 找出最大值
min — 找出最小值
mt_getrandmax — 顯示隨機數的最大可能值
mt_rand — 產生更好的隨機數
mt_srand — 播下一個更好的隨機數發生器種子
octdec — 八進位轉換為十進位
pi — 得到圓周率值
pow — 指數運算式
rad2deg — 將弧度數轉換為相應的角度數
rand — 產生一個隨機整數
round — 對浮點數進行四捨五入
sin — 正弦
sinh — 雙曲正弦
sqrt — 平方根
srand — 播下隨機數發生器種子
tan — 正切
tanh — 雙曲正切
字串函數:
多多益善,至少掌握20個吧。較常用標紅。
addcslashes — 以 C 語言風格使用反斜線逸出字元串中的字元
addslashes — 使用反斜線引用字串
bin2hex — 將位元據轉換成十六進位表示
chop — rtrim 的別名
chr — 返回指定的字元
chunk_split — 將字串分割成小塊
convert_cyr_string — 將字元由一種 Cyrillic 字元轉換成另一種
convert_uudecode — 解碼一個 uuencode 編碼的字串
convert_uuencode — 使用 uuencode 編碼一個字串
count_chars — 返回字串所用字元的資訊
crc32 — 計算一個字串的 crc32 多項式
crypt — 單向字串散列
echo — 輸出一個或多個字串
explode — 使用一個字串分割另一個字串
fprintf — 將格式化後的字串寫入到流
get_html_translation_table — 返回使用 htmlspecialchars 和 htmlentities 後的轉換表
hebrev — 將邏輯順序希伯來文(logical-Hebrew)轉換為視覺順序希伯來文(visual-Hebrew)
hebrevc — 將邏輯順序希伯來文(logical-Hebrew)轉換為視覺順序希伯來文(visual-Hebrew),並且轉換分行符號
html_entity_decode — Convert all HTML entities to their applicable characters
htmlentities — Convert all applicable characters to HTML entities
htmlspecialchars_decode — Convert special HTML entities back to characters
htmlspecialchars — Convert special characters to HTML entities
implode — Join array elements with a string
join — 別名 implode
lcfirst — Make a string's first character lowercase
levenshtein — Calculate Levenshtein distance between two strings
localeconv — Get numeric formatting information
ltrim — Strip whitespace (or other characters) from the beginning of a string
md5_file — 計算指定檔案的 MD5 散列值
md5 — 計算字串的 MD5 散列值
metaphone — Calculate the metaphone key of a string
money_format — Formats a number as a currency string
nl_langinfo — Query language and locale information
nl2br — 在字串所有新行之前插入 HTML 換行標記
number_format — Format a number with grouped thousands
ord — 返回字元的 ASCII 碼值
parse_str — Parses the string into variables
print — 輸出字串
printf — 輸出格式化字串
quoted_printable_decode — Convert a quoted-printable string to an 8 bit string
quoted_printable_encode — Convert a 8 bit string to a quoted-printable string
quotemeta — Quote meta characters
rtrim — 刪除字串末端的空白字元(或者其他字元)
setlocale — Set locale information
sha1_file — 計算檔案的 sha1 散列值
sha1 — 計算字串的 sha1 散列值
similar_text — 計算兩個字串的相似性
soundex — Calculate the soundex key of a string
sprintf — Return a formatted string
sscanf — Parses input from a string according to a format
str_getcsv — 解析 CSV 字串為一個數組
str_ireplace — str_replace 的忽略大小寫版本
str_pad — 使用另一個字串填充字串為指定長度
str_repeat — 重複一個字串
str_replace — 子字串替換
str_rot13 — 對字串執行 ROT13 轉換
str_shuffle — 隨機打亂一個字串
str_split — 將字串轉換為數組
str_word_count — 返回字串中單詞的使用方式
strcasecmp — 二進位安全比較字串(不區分大小寫)
strchr — 別名 strstr
strcmp — 二進位安全字串比較
strcoll — 基於地區設定的字串比較
strcspn — 擷取不匹配遮罩的起始子字串的長度
strip_tags — 從字串中去除 HTML 和 PHP 標記
stripcslashes — 反引用一個使用 addcslashes 轉義的字串
stripos — 尋找字串首次出現的位置(不區分大小寫)
stripslashes — 反引用一個引用字串
stristr — strstr 函數的忽略大小寫版本
strlen — 擷取字串長度
strnatcasecmp — 使用“自然順序”演算法比較字串(不區分大小寫)
strnatcmp — 使用自然排序演算法比較字串
strncasecmp — 二進位安全比較字串開頭的若干個字元(不區分大小寫)
strncmp — 二進位安全比較字串開頭的若干個字元
strpbrk — 在字串中尋找一組字元的任何一個字元
strpos — 尋找字串首次出現的位置
strrchr — 尋找指定字元在字串中的最後一次出現
strrev — 反轉字串
strripos — 計算指定字串在目標字串中最後一次出現的位置(不區分大小寫)
strrpos — 計算指定字串在目標字串中最後一次出現的位置
strspn — 計算字串中全部字元都存在於指定字元集合中的第一段子串的長度。
strstr — 尋找字串的首次出現
strtok — 標記分割字串
strtolower — 將字串轉化為小寫
strtoupper — 將字串轉化為大寫
strtr — 轉換指定字元
substr_compare — 二進位安全比較字串(從位移位置比較指定長度)
substr_count — 計算字串出現的次數
substr_replace — 替換字串的子串
substr — 返回字串的子串
trim — 去除字串首尾處的空白字元(或者其他字元)
ucfirst — 將字串的首字母轉換為大寫
ucwords — 將字串中每個單詞的首字母轉換為大寫
vfprintf — 將格式化字串寫入流
vprintf — 輸出格式化字串
vsprintf — 返回格式化字串
wordwrap — 打斷字串為指定數量的字串
數組 函數
多多益善,至少掌握15個吧。較常用標紅。
array_change_key_case — 返回字串鍵名全為小寫或大寫的數組
array_chunk — 將一個數組分割成多個
array_combine — 建立一個數組,用一個數組的值作為其鍵名,另一個數組的值作為其值
array_count_values — 統計數組中所有的值出現的次數
array_diff_assoc — 帶索引檢查計算數組的差集
array_diff_key — 使用鍵名比較計算數組的差集
array_diff_uassoc — 用使用者提供的回呼函數做索引檢查來計算數組的差集
array_diff_ukey — 用回呼函數對鍵名比較計算數組的差集
array_diff — 計算數組的差集
array_fill_keys — 使用指定的鍵和值填充數組
array_fill — 用給定的值填充數組
array_filter — 用回呼函數過濾數組中的單元
array_flip — 交換數組中的鍵和值
array_intersect_assoc — 帶索引檢查計算數組的交集
array_intersect_key — 使用鍵名比較計算數組的交集
array_intersect_uassoc — 帶索引檢查計算數組的交集,用回呼函數比較索引
array_intersect_ukey — 用回呼函數比較鍵名來計算數組的交集
array_intersect — 計算數組的交集
array_key_exists — 檢查給定的鍵名或索引是否存在於數組中
array_keys — 返回數組中所有的鍵名
array_map — 將回呼函數作用到給定數組的單元上
array_merge_recursive — 遞迴地合并一個或多個數組
array_merge — 合并一個或多個數組
array_multisort — 對多個數組或多維陣列進行排序
array_pad — 用值將數組填補到指定長度
array_pop — 將數組最後一個單元彈出(出棧)
array_product — 計算數組中所有值的乘積
array_push — 將一個或多個單元壓入數組的末尾(入棧)
array_rand — 從數組中隨機取出一個或多個單元
array_reduce — 用回呼函數迭代地將數組簡化為單一的值
array_replace_recursive — 使用傳遞的數組遞迴替換第一個數組的元素
array_replace — 使用傳遞的數組替換第一個數組的元素
array_reverse — 返回一個單元順序相反的數組
array_search — 在數組中搜尋給定的值,如果成功則返回相應的鍵名
array_shift — 將數組開頭的單元移出數組
array_slice — 從數組中取出一段
array_splice — 把數組中的一部分去掉並用其它值取代
array_sum — 計算數組中所有值的和
array_udiff_assoc — 帶索引檢查計算數組的差集,用回呼函數比較資料
array_udiff_uassoc — 帶索引檢查計算數組的差集,用回呼函數比較資料和索引
array_udiff — 用回呼函數比較資料來計算數組的差集
array_uintersect_assoc — 帶索引檢查計算數組的交集,用回呼函數比較資料
array_uintersect_uassoc — 帶索引檢查計算數組的交集,用回呼函數比較資料和索引
array_uintersect — 計算數組的交集,用回呼函數比較資料
array_unique — 移除數組中重複的值
array_unshift — 在數組開頭插入一個或多個單元
array_values — 返回數組中所有的值
array_walk_recursive — 對數組中的每個成員遞迴地應用使用者函數
array_walk — 對數組中的每個成員應用使用者函數
array — 建立一個數組
arsort — 對數組進行逆向排序並保持索引關係
asort — 對數組進行排序並保持索引關係
compact — 建立一個數組,包括變數名和它們的值
count — 計算數組中的單元數目或對象中的屬性個數
current — 返回數組中的當前單元
each — 返回數組中當前的鍵/值對並將數組指標向前移動一步
end — 將數組的內部指標指向最後一個單元
extract — 從數組中將變數匯入到當前的符號表
in_array — 檢查數組中是否存在某個值
key — 從關聯陣列中取得鍵名
krsort — 對數組按照鍵名逆向排序
ksort — 對數組按照鍵名排序
list — 把數組中的值賦給一些變數
natcasesort — 用“自然排序”演算法對數組進行不區分大小寫字母的排序
natsort — 用“自然排序”演算法對數組排序
next — 將數組中的內部指標向前移動一位
pos — current 的別名
prev — 將數組的內部指標倒回一位
range — 建立一個包含指定範圍單元的數組
reset — 將數組的內部指標指向第一個單元
rsort — 對數組逆向排序
shuffle — 將數組打亂
sizeof — count 的別名
sort — 對數組排序
uasort — 使用使用者自訂的比較函數對數組中的值進行排序並保持索引關聯
uksort — 使用使用者自訂的比較函數對數組中的鍵名進行排序
usort — 使用使用者自訂的比較函數對數組中的值進行排
http://www.bkjia.com/PHPjc/477505.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477505.htmlTechArticleMath函數: 10個較常用標紅。 abs 絕對值 acos 反餘弦 acosh 反雙曲餘弦 asin 反正弦 asinh 反雙曲正弦 atan2 兩個參數的反正切 atan 反正切 atanh 反雙...