基於PHP中的常用函數回顧_php執行個體
來源:互聯網
上載者:User
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 — Fill an array with values, specifying 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_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 — 使用使用者自訂的比較函數對數組中的值進行排序
call_user_method_array — 調用一個使用者方法,同時傳遞參數數組(已廢棄)
call_user_method — 對特定對象調用使用者方法(已廢棄)
class_exists — 檢查類是否已定義
get_class_methods — 返回由類的方法名組成的數組
get_class_vars — 返回由類的預設屬性組成的數組
get_class — 返回對象的類名
get_declared_classes — 返回由已定義類的名字所組成的數組
get_declared_interfaces — 返回一個數組包含所有已聲明的介面
get_object_vars — 返回由對象屬性群組成的關聯陣列
get_parent_class — 返回對象或類的父類名
interface_exists — 檢查介面是否已被定義
is_a — 如果對象屬於該類或該類是此對象的父類則返回 TRUE
is_subclass_of — 如果此對象是該類的子類,則返回 TRUE
method_exists — 檢查類的方法是否存在
property_exists — 檢查對象或類是否具有該屬性
checkdate — 驗證一個格裡高裡日期
date_default_timezone_get — 取得一個指令碼中所有日期時間函數所使用的預設時區
date_default_timezone_set — 設定用於一個指令碼中所有日期時間函數的預設時區
date_time_set — Sets the time
date_timezone_get — Return time zone relative to given DateTime
date_timezone_set — Sets the time zone for the DateTime object
date — 格式化一個本地時間/日期
getdate — 取得日期/時間資訊
gettimeofday — 取得目前時間
gmdate — 格式化一個 GMT/UTC 日期/時間
gmmktime — 取得 GMT 日期的 UNIX 時間戳記
gmstrftime — 根據地區設定格式化 GMT/UTC 時間/日期
idate — 將本地時間日期格式化為整數
localtime — 取得本地時間
microtime — 返回當前 Unix 時間戳記和微秒數
mktime — 取得一個日期的 Unix 時間戳記
strftime — 根據地區設定格式化本地時間/日期
strptime — 解析由 strftime() 產生的日期/時間
strtotime — 將任何英文文本的日期時間描述解析為 Unix 時間戳記
time — 返回當前的 Unix 時間戳記
chdir — 改變目錄
chroot — 改變根目錄
dir — directory 類
closedir — 關閉目錄控制代碼
getcwd — 取得當前工作目錄
opendir — 開啟目錄控制代碼
readdir — 從目錄控制代碼中讀取條目
rewinddir — 倒回目錄控制代碼
scandir — 列出指定路徑中的檔案和目錄
basename — 返迴路徑中的檔案名稱部分
chgrp — 改變檔案所屬的組
chmod — 改變檔案模式
chown — 改變檔案的所有者
clearstatcache — 清除檔案狀態緩衝
copy — 拷貝檔案
delete — 參見 unlink() 或 unset()
dirname — 返迴路徑中的目錄部分
disk_free_space — 返回目錄中的可用空間
disk_total_space — 返回一個目錄的磁碟總大小
diskfreespace — disk_free_space() 的別名
fclose — 關閉一個已開啟的檔案指標
feof — 測試檔案指標是否到了檔案結束的位置
fflush — 將緩衝內容輸出到檔案
fgetc — 從檔案指標中讀取字元
fgetcsv — 從檔案指標中讀入一行並解析 CSV 欄位
fgets — 從檔案指標中讀取一行
fgetss — 從檔案指標中讀取一行並過濾掉 HTML 標籤
file_exists — 檢查檔案或目錄是否存在
file_get_contents — 將整個檔案讀入一個字串
file_put_contents — 將一個字串寫入檔案
file — 把整個檔案讀入一個數組中
fileatime — 取得檔案的上次訪問時間
filectime — 取得檔案的 inode 修改時間
filegroup — 取得檔案的組
fileinode — 取得檔案的 inode
filemtime — 取得檔案修改時間
fileowner — 取得檔案的所有者
fileperms — 取得檔案的許可權
filesize — 取得檔案大小
filetype — 取得檔案類型
flock — 輕便的諮詢檔案鎖定
fnmatch — 用模式比對檔案名稱
fopen — 開啟檔案或者 URL
fpassthru — 輸出檔案指標處的所有剩餘資料
fputcsv — 將行格式化為 CSV 並寫入檔案指標
fputs — fwrite() 的別名
fread — 讀取檔案(可安全用於二進位檔案)
fscanf — 從檔案中格式化輸入
fseek — 在檔案指標中定位
fstat — 通過已開啟的檔案指標取得檔案資訊
ftell — 返迴文件指標讀/寫的位置
ftruncate — 將檔案截斷到給定的長度
fwrite — 寫入檔案(可安全用於二進位檔案)
glob — 尋找與模式比對的檔案路徑
is_dir — 判斷給定檔案名稱是否是一個目錄
is_executable — 判斷給定檔案名稱是否可執行
is_file — 判斷給定檔案名稱是否為一個正常的檔案
is_link — 判斷給定檔案名稱是否為一個符號串連
is_readable — 判斷給定檔案名稱是否可讀
is_uploaded_file — 判斷檔案是否是通過 HTTP POST 上傳的
is_writable — 判斷給定的檔案名稱是否可寫
is_writeable — is_writable() 的別名
lchgrp — Changes group ownership of symlink
lchown — Changes user ownership of symlink
link — 建立一個硬串連
linkinfo — 擷取一個串連的資訊
lstat — 給出一個檔案或符號串連的資訊
mkdir — 建立目錄
move_uploaded_file — 將上傳的檔案移動到新位置
parse_ini_file — 解析一個設定檔
pathinfo — 返迴文件路徑的資訊
pclose — 關閉進程檔案指標
popen — 開啟進程檔案指標
readfile — 輸出一個檔案
readlink — 返回符號串連指向的目標
realpath — 返回正常化的絕對路徑名
rename — 重新命名一個檔案或目錄
rewind — 倒迴文件指標的位置
rmdir — 刪除目錄
set_file_buffer — stream_set_write_buffer() 的別名
stat — 給出檔案的資訊
symlink — 建立符號串連
tempnam — 建立一個具有唯一檔案名的檔案
tmpfile — 建立一個臨時檔案
touch — 設定檔案的訪問和修改時間
umask — 改變當前的 umask
unlink — 刪除檔案
mail — 發送郵件
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 — 雙曲正切
mysql_affected_rows — 取得前一次 MySQL 操作所影響的記錄行數
mysql_change_user — 改變活動串連中登入的使用者
mysql_client_encoding — 返回字元集的名稱
mysql_close — 關閉 MySQL 串連
mysql_connect — 開啟一個到 MySQL 伺服器的串連
mysql_create_db — 建立一個 MySQL 資料庫
mysql_data_seek — 移動內部結果的指標
mysql_db_name — 取得結果資料
mysql_db_query — 發送一條 MySQL 查詢
mysql_drop_db — 丟棄(刪除)一個 MySQL 資料庫
mysql_errno — 返回上一個 MySQL 操作中的錯誤資訊的數字編碼
mysql_error — 返回上一個 MySQL 操作產生的文本錯誤資訊
mysql_escape_string — 轉義一個字串用於 mysql_query
mysql_fetch_array — 從結果集中取得一行作為關聯陣列,或數字數組,或二者兼有
mysql_fetch_assoc — 從結果集中取得一行作為關聯陣列
mysql_fetch_field — 從結果集中取得列資訊並作為對象返回
mysql_fetch_lengths — 取得結果集中每個輸出的長度
mysql_fetch_object — 從結果集中取得一行作為對象
mysql_fetch_row — 從結果集中取得一行作為枚舉數組
mysql_field_flags — 從結果中取得和指定欄位關聯的標誌
mysql_field_len — 返回指定欄位的長度
mysql_field_name — 取得結果中指定欄位的欄位名
mysql_field_seek — 將結果集中的指標設定為制定的欄位位移量
mysql_field_table — 取得指定欄位所在的表名
mysql_field_type — 取得結果集中指定欄位的類型
mysql_free_result — 釋放結果記憶體
mysql_get_client_info — 取得 MySQL 用戶端資訊
mysql_get_host_info — 取得 MySQL 主機資訊
mysql_get_proto_info — 取得 MySQL 協議資訊
mysql_get_server_info — 取得 MySQL 伺服器資訊
mysql_info — 取得最近一條查詢的資訊
mysql_insert_id — 取得上一步 INSERT 操作產生的 ID
mysql_list_dbs — 列出 MySQL 伺服器中所有的資料庫
mysql_list_fields — 列出 MySQL 結果中的欄位
mysql_list_processes — 列出 MySQL 進程
mysql_list_tables — 列出 MySQL 資料庫中的表
mysql_num_fields — 取得結果集中欄位的數目
mysql_num_rows — 取得結果集中行的數目
mysql_pconnect — 開啟一個到 MySQL 伺服器的持久串連
mysql_ping — Ping 一個伺服器串連,如果沒有串連則重新串連
mysql_query — 發送一條 MySQL 查詢
mysql_real_escape_string — 轉義 SQL 陳述式中使用的字串中的特殊字元,並考慮到串連的當前字元集
mysql_result — 取得結果資料
mysql_select_db — 選擇 MySQL 資料庫
mysql_stat — 取得當前系統狀態
mysql_tablename — 取得表名
mysql_thread_id — 返回當前線程的 ID
mysql_unbuffered_query — 向 MySQL 發送一條 SQL 查詢,並不擷取和緩衝結果的行
flush — 重新整理輸出緩衝
ob_clean — Clean (erase) the output buffer
ob_end_clean — Clean (erase) the output buffer and turn off output buffering
ob_end_flush — Flush (send) the output buffer and turn off output buffering
ob_flush — Flush (send) the output buffer
ob_get_clean — Get current buffer contents and delete current output buffer
ob_get_contents — Return the contents of the output buffer
ob_get_flush — Flush the output buffer, return it as a string and turn off output buffering
ob_get_length — Return the length of the output buffer
ob_get_level — Return the nesting level of the output buffering mechanism
ob_get_status — Get status of output buffers
ob_gzhandler — ob_start callback function to gzip output buffer
ob_implicit_flush — Turn implicit flush on/off
ob_list_handlers — List all output handlers in use
ob_start — Turn on output buffering
output_add_rewrite_var — Add URL rewriter values
output_reset_rewrite_vars — Reset URL rewriter values
preg_grep — 返回與模式比對的數組單元
preg_last_error — Returns the error code of the last PCRE regex execution
preg_match_all — 進行全域Regex匹配
preg_match — 進行Regex匹配
preg_quote — 轉義Regex字元
preg_replace_callback — 用回呼函數執行Regex的搜尋和替換
preg_replace — 執行Regex的搜尋和替換
preg_split — 用Regex分割字串
session_cache_expire — Return current cache expire
session_cache_limiter — Get and/or set the current cache limiter
session_commit — session_write_close() 的別名
session_decode — Decodes session data from a string
session_destroy — Destroys all data registered to a session
session_encode — 將當前會話資料編碼為一個字串
session_get_cookie_params — Get the session cookie parameters
session_id — Get and/or set the current session id
session_is_registered — Find out whether a global variable is registered in a session
session_module_name — Get and/or set the current session module
session_name — Get and/or set the current session name
session_regenerate_id — Update the current session id with a newly generated one
session_register — Register one or more global variables with the current session
session_save_path — Get and/or set the current session save path
session_set_cookie_params — Set the session cookie parameters
session_set_save_handler — Sets user-level session storage functions
session_start — Initialize session data
session_unregister — Unregister a global variable from the current session
session_unset — Free all session variables
session_write_close — Write session data and end session
ereg_replace — Regex替換
ereg — Regex匹配
eregi_replace — 不區分大小寫Regex替換
eregi — 不區分大小寫Regex匹配
split — 用Regex將字串分割到數組中
spliti — 用Regex不區分大小寫將字串分割到數組中
sql_regcase — 產生用於不區分大小的匹配的Regex
addcslashes — 以 C 語言風格使用反斜線逸出字元串中的字元
addslashes — 使用反斜線引用字串
bin2hex — 將位元據轉換成十六進位表示
chop — rtrim() 的別名
chr — 返回指定的字元
chunk_split — 將字串分割成小塊
count_chars — 返回字串所用字元的資訊
crc32 — 計算一個字串的 crc32 多項式
crypt — One-way string encryption (hashing)
echo — Output one or more strings
explode — 使用一個字串分割另一個字串
fprintf — Write a formatted string to a stream
get_html_translation_table — Returns the translation table used by htmlspecialchars() and htmlentities()
hebrev — Convert logical Hebrew text to visual text
hebrevc — Convert logical Hebrew text to visual text with newline conversion
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()
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 — Calculates the md5 hash of a given file
md5 — Calculate the md5 hash of a string
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 — Inserts HTML line breaks before all newlines in a string
number_format — Format a number with grouped thousands
ord — Return ASCII value of character
parse_str — Parses the string into variables
print — Output a string
printf — Output a formatted string
quoted_printable_decode — Convert a quoted-printable string to an 8 bit string
quotemeta — Quote meta characters
rtrim — Strip whitespace (or other characters) from the end of a string
setlocale — Set locale information
sha1_file — Calculate the sha1 hash of a file
sha1 — Calculate the sha1 hash of a string
similar_text — Calculate the similarity between two strings
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 — Parse a CSV string into an array
str_ireplace — Case-insensitive version of str_replace().
str_pad — Pad a string to a certain length with another string
str_repeat — Repeat a string
str_replace — Replace all occurrences of the search string with the replacement string
str_rot13 — Perform the rot13 transform on a string
str_shuffle — Randomly shuffles a string
str_split — Convert a string to an array
str_word_count — Return information about words used in a string
strcasecmp — Binary safe case-insensitive string comparison
strchr — 別名 strstr()
strcmp — Binary safe string comparison
strcoll — Locale based string comparison
strcspn — Find length of initial segment not matching mask
strip_tags — Strip HTML and PHP tags from a string
stripcslashes — Un-quote string quoted with addcslashes()
stripos — Find position of first occurrence of a case-insensitive string
stripslashes — Un-quote string quoted with addslashes()
stristr — Case-insensitive strstr()
strlen — Get string length
strnatcasecmp — Case insensitive string comparisons using a “natural order” algorithm
strnatcmp — String comparisons using a “natural order” algorithm
strncasecmp — Binary safe case-insensitive string comparison of the first n characters
strncmp — Binary safe string comparison of the first n characters
strpbrk — Search a string for any of a set of characters
strpos — Find position of first occurrence of a string
strrchr — Find the last occurrence of a character in a string
strrev — Reverse a string
strripos — Find position of last occurrence of a case-insensitive string in a string
strrpos — Find position of last occurrence of a char in a string
strspn — Find length of initial segment matching mask
strstr — Find first occurrence of a string
strtok — Tokenize string
strtolower — Make a string lowercase
strtoupper — Make a string uppercase
strtr — Translate certain characters
substr_compare — Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters
substr_count — Count the number of substring occurrences
substr_replace — Replace text within a portion of a string
substr — Return part of a string
trim — Strip whitespace (or other characters) from the beginning and end of a string
ucfirst — Make a string's first character uppercase
ucwords — Uppercase the first character of each word in a string
vfprintf — Write a formatted string to a stream
vprintf — Output a formatted string
vsprintf — Return a formatted string
wordwrap — Wraps a string to a given number of characters using a string break character
base64_decode — 對使用 MIME base64 編碼的資料進行解碼
base64_encode — 使用 MIME base64 對資料進行編碼
get_headers — 取得伺服器響應一個 HTTP 要求所發送的所有標題
get_meta_tags — 從一個檔案中提取所有的 meta 標籤 content 屬性,返回一個數組
http_build_query — 產生 URL-encode 之後的請求字串
parse_url — 解析 URL,返回其組成部分
rawurldecode — 對已編碼的 URL 字串進行解碼
rawurlencode — 按照 RFC 1738 對 URL 進行編碼
urldecode — 解碼已編碼的 URL 字串
urlencode — 編碼 URL 字串
debug_zval_dump — Dumps a string representation of an internal zend value to output
doubleval — floatval() 的別名
empty — 檢查一個變數是否為空白
floatval — 擷取變數的浮點值
get_defined_vars — 返回由所有已定義變數所組成的數組
get_resource_type — 返回資源(resource)類型
gettype — 擷取變數的類型
import_request_variables — 將 GET/POST/Cookie 變數匯入到全域範圍中
intval — 擷取變數的整數值
is_array — 檢測變數是否是數組
is_binary — Finds whether a variable is a native binary string
is_bool — 檢測變數是否是布爾型
is_buffer — Finds whether a variable is a native unicode or binary string
is_callable — 檢測參數是否為合法的可調用結構
is_double — is_float() 的別名
is_float — 檢測變數是否是浮點型
is_int — 檢測變數是否是整數
is_integer — is_int() 的別名
is_long — is_int() 的別名
is_null — 檢測變數是否為 NULL
is_numeric — 檢測變數是否為數字或數字字串
is_object — 檢測變數是否是一個對象
is_real — is_float() 的別名
is_resource — 檢測變數是否為資源類型
is_scalar — 檢測變數是否是一個標量
is_string — 檢測變數是否是字串
is_unicode — Finds whether a variable is a unicode string
isset — 檢測變數是否設定
print_r — 列印關於變數的易於理解的資訊。
serialize — 產生一個可儲存的值的表示
settype — 設定變數的類型
strval — 擷取變數的字串值
unserialize — 從已儲存的表示中建立 PHP 的值
unset — 釋放給定的變數
var_dump — 列印變數的相關資訊
var_export — 輸出或返回一個變數的字串表示