溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

PHP有哪些常用的函數(shù)

發(fā)布時(shí)間:2021-01-13 15:40:17 來源:億速云 閱讀:150 作者:Leah 欄目:開發(fā)技術(shù)

這篇文章給大家介紹PHP有哪些常用的函數(shù),內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。

array_change_key_case — 返回字符串鍵名全為小寫或大寫的數(shù)組
array_chunk — 將一個(gè)數(shù)組分割成多個(gè)
array_combine — 創(chuàng)建一個(gè)數(shù)組,用一個(gè)數(shù)組的值作為其鍵名,另一個(gè)數(shù)組的值作為其值
array_count_values — 統(tǒng)計(jì)數(shù)組中所有的值出現(xiàn)的次數(shù)
array_diff_assoc — 帶索引檢查計(jì)算數(shù)組的差集
array_diff_key — 使用鍵名比較計(jì)算數(shù)組的差集
array_diff_uassoc — 用用戶提供的回調(diào)函數(shù)做索引檢查來計(jì)算數(shù)組的差集
array_diff_ukey — 用回調(diào)函數(shù)對鍵名比較計(jì)算數(shù)組的差集
array_diff — 計(jì)算數(shù)組的差集
array_fill_keys — Fill an array with values, specifying keys
array_fill — 用給定的值填充數(shù)組
array_filter — 用回調(diào)函數(shù)過濾數(shù)組中的單元
array_flip — 交換數(shù)組中的鍵和值
array_intersect_assoc — 帶索引檢查計(jì)算數(shù)組的交集
array_intersect_key — 使用鍵名比較計(jì)算數(shù)組的交集
array_intersect_uassoc — 帶索引檢查計(jì)算數(shù)組的交集,用回調(diào)函數(shù)比較索引
array_intersect_ukey — 用回調(diào)函數(shù)比較鍵名來計(jì)算數(shù)組的交集
array_intersect — 計(jì)算數(shù)組的交集
array_key_exists — 檢查給定的鍵名或索引是否存在于數(shù)組中
array_keys — 返回?cái)?shù)組中所有的鍵名
array_map — 將回調(diào)函數(shù)作用到給定數(shù)組的單元上
array_merge_recursive — 遞歸地合并一個(gè)或多個(gè)數(shù)組
array_merge — 合并一個(gè)或多個(gè)數(shù)組
array_multisort — 對多個(gè)數(shù)組或多維數(shù)組進(jìn)行排序
array_pad — 用值將數(shù)組填補(bǔ)到指定長度
array_pop — 將數(shù)組最后一個(gè)單元彈出(出棧)
array_product — 計(jì)算數(shù)組中所有值的乘積
array_push — 將一個(gè)或多個(gè)單元壓入數(shù)組的末尾(入棧)
array_rand — 從數(shù)組中隨機(jī)取出一個(gè)或多個(gè)單元
array_reduce — 用回調(diào)函數(shù)迭代地將數(shù)組簡化為單一的值
array_reverse — 返回一個(gè)單元順序相反的數(shù)組
array_search — 在數(shù)組中搜索給定的值,如果成功則返回相應(yīng)的鍵名
array_shift — 將數(shù)組開頭的單元移出數(shù)組
array_slice — 從數(shù)組中取出一段
array_splice — 把數(shù)組中的一部分去掉并用其它值取代
array_sum — 計(jì)算數(shù)組中所有值的和
array_udiff_assoc — 帶索引檢查計(jì)算數(shù)組的差集,用回調(diào)函數(shù)比較數(shù)據(jù)
array_udiff_uassoc — 帶索引檢查計(jì)算數(shù)組的差集,用回調(diào)函數(shù)比較數(shù)據(jù)和索引
array_udiff — 用回調(diào)函數(shù)比較數(shù)據(jù)來計(jì)算數(shù)組的差集
array_uintersect_assoc — 帶索引檢查計(jì)算數(shù)組的交集,用回調(diào)函數(shù)比較數(shù)據(jù)
array_uintersect_uassoc — 帶索引檢查計(jì)算數(shù)組的交集,用回調(diào)函數(shù)比較數(shù)據(jù)和索引
array_uintersect — 計(jì)算數(shù)組的交集,用回調(diào)函數(shù)比較數(shù)據(jù)
array_unique — 移除數(shù)組中重復(fù)的值
array_unshift — 在數(shù)組開頭插入一個(gè)或多個(gè)單元
array_values — 返回?cái)?shù)組中所有的值
array_walk_recursive — 對數(shù)組中的每個(gè)成員遞歸地應(yīng)用用戶函數(shù)
array_walk — 對數(shù)組中的每個(gè)成員應(yīng)用用戶函數(shù)
array — 新建一個(gè)數(shù)組
arsort — 對數(shù)組進(jìn)行逆向排序并保持索引關(guān)系
asort — 對數(shù)組進(jìn)行排序并保持索引關(guān)系
compact — 建立一個(gè)數(shù)組,包括變量名和它們的值
count — 計(jì)算數(shù)組中的單元數(shù)目或?qū)ο笾械膶傩詡€(gè)數(shù)
current — 返回?cái)?shù)組中的當(dāng)前單元
each — 返回?cái)?shù)組中當(dāng)前的鍵/值對并將數(shù)組指針向前移動一步
end — 將數(shù)組的內(nèi)部指針指向最后一個(gè)單元
extract — 從數(shù)組中將變量導(dǎo)入到當(dāng)前的符號表
in_array — 檢查數(shù)組中是否存在某個(gè)值
key — 從關(guān)聯(lián)數(shù)組中取得鍵名
krsort — 對數(shù)組按照鍵名逆向排序
ksort — 對數(shù)組按照鍵名排序
list — 把數(shù)組中的值賦給一些變量
natcasesort — 用“自然排序”算法對數(shù)組進(jìn)行不區(qū)分大小寫字母的排序
natsort — 用“自然排序”算法對數(shù)組排序
next — 將數(shù)組中的內(nèi)部指針向前移動一位
pos — current() 的別名
prev — 將數(shù)組的內(nèi)部指針倒回一位
range — 建立一個(gè)包含指定范圍單元的數(shù)組
reset — 將數(shù)組的內(nèi)部指針指向第一個(gè)單元
rsort — 對數(shù)組逆向排序
shuffle — 將數(shù)組打亂
sizeof — count() 的別名
sort — 對數(shù)組排序
uasort — 使用用戶自定義的比較函數(shù)對數(shù)組中的值進(jìn)行排序并保持索引關(guān)聯(lián)
uksort — 使用用戶自定義的比較函數(shù)對數(shù)組中的鍵名進(jìn)行排序
usort — 使用用戶自定義的比較函數(shù)對數(shù)組中的值進(jìn)行排序
call_user_method_array — 調(diào)用一個(gè)用戶方法,同時(shí)傳遞參數(shù)數(shù)組(已廢棄)
call_user_method — 對特定對象調(diào)用用戶方法(已廢棄)
class_exists — 檢查類是否已定義
get_class_methods — 返回由類的方法名組成的數(shù)組
get_class_vars — 返回由類的默認(rèn)屬性組成的數(shù)組
get_class — 返回對象的類名
get_declared_classes — 返回由已定義類的名字所組成的數(shù)組
get_declared_interfaces — 返回一個(gè)數(shù)組包含所有已聲明的接口
get_object_vars — 返回由對象屬性組成的關(guān)聯(lián)數(shù)組
get_parent_class — 返回對象或類的父類名
interface_exists — 檢查接口是否已被定義
is_a — 如果對象屬于該類或該類是此對象的父類則返回 TRUE
is_subclass_of — 如果此對象是該類的子類,則返回 TRUE
method_exists — 檢查類的方法是否存在
property_exists — 檢查對象或類是否具有該屬性
checkdate — 驗(yàn)證一個(gè)格里高里日期
date_default_timezone_get — 取得一個(gè)腳本中所有日期時(shí)間函數(shù)所使用的默認(rèn)時(shí)區(qū)
date_default_timezone_set — 設(shè)定用于一個(gè)腳本中所有日期時(shí)間函數(shù)的默認(rèn)時(shí)區(qū)
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 — 格式化一個(gè)本地時(shí)間/日期
getdate — 取得日期/時(shí)間信息
gettimeofday — 取得當(dāng)前時(shí)間
gmdate — 格式化一個(gè) GMT/UTC 日期/時(shí)間
gmmktime — 取得 GMT 日期的 UNIX 時(shí)間戳
gmstrftime — 根據(jù)區(qū)域設(shè)置格式化 GMT/UTC 時(shí)間/日期
idate — 將本地時(shí)間日期格式化為整數(shù)
localtime — 取得本地時(shí)間
microtime — 返回當(dāng)前 Unix 時(shí)間戳和微秒數(shù)
mktime — 取得一個(gè)日期的 Unix 時(shí)間戳
strftime — 根據(jù)區(qū)域設(shè)置格式化本地時(shí)間/日期
strptime — 解析由 strftime() 生成的日期/時(shí)間
strtotime — 將任何英文文本的日期時(shí)間描述解析為 Unix 時(shí)間戳
time — 返回當(dāng)前的 Unix 時(shí)間戳
chdir — 改變目錄
chroot — 改變根目錄
dir — directory 類
closedir — 關(guān)閉目錄句柄
getcwd — 取得當(dāng)前工作目錄
opendir — 打開目錄句柄
readdir — 從目錄句柄中讀取條目
rewinddir — 倒回目錄句柄
scandir — 列出指定路徑中的文件和目錄
basename — 返回路徑中的文件名部分
chgrp — 改變文件所屬的組
chmod — 改變文件模式
chown — 改變文件的所有者
clearstatcache — 清除文件狀態(tài)緩存
copy — 拷貝文件
delete — 參見 unlink() 或 unset()
dirname — 返回路徑中的目錄部分
disk_free_space — 返回目錄中的可用空間
disk_total_space — 返回一個(gè)目錄的磁盤總大小
diskfreespace — disk_free_space() 的別名
fclose — 關(guān)閉一個(gè)已打開的文件指針
feof — 測試文件指針是否到了文件結(jié)束的位置
fflush — 將緩沖內(nèi)容輸出到文件
fgetc — 從文件指針中讀取字符
fgetcsv — 從文件指針中讀入一行并解析 CSV 字段
fgets — 從文件指針中讀取一行
fgetss — 從文件指針中讀取一行并過濾掉 HTML 標(biāo)記
file_exists — 檢查文件或目錄是否存在
file_get_contents — 將整個(gè)文件讀入一個(gè)字符串
file_put_contents — 將一個(gè)字符串寫入文件
file — 把整個(gè)文件讀入一個(gè)數(shù)組中
fileatime — 取得文件的上次訪問時(shí)間
filectime — 取得文件的 inode 修改時(shí)間
filegroup — 取得文件的組
fileinode — 取得文件的 inode
filemtime — 取得文件修改時(shí)間
fileowner — 取得文件的所有者
fileperms — 取得文件的權(quán)限
filesize — 取得文件大小
filetype — 取得文件類型
flock — 輕便的咨詢文件鎖定
fnmatch — 用模式匹配文件名
fopen — 打開文件或者 URL
fpassthru — 輸出文件指針處的所有剩余數(shù)據(jù)
fputcsv — 將行格式化為 CSV 并寫入文件指針
fputs — fwrite() 的別名
fread — 讀取文件(可安全用于二進(jìn)制文件)
fscanf — 從文件中格式化輸入
fseek — 在文件指針中定位
fstat — 通過已打開的文件指針取得文件信息
ftell — 返回文件指針讀/寫的位置
ftruncate — 將文件截?cái)嗟浇o定的長度
fwrite — 寫入文件(可安全用于二進(jìn)制文件)
glob — 尋找與模式匹配的文件路徑
is_dir — 判斷給定文件名是否是一個(gè)目錄
is_executable — 判斷給定文件名是否可執(zhí)行
is_file — 判斷給定文件名是否為一個(gè)正常的文件
is_link — 判斷給定文件名是否為一個(gè)符號連接
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 — 建立一個(gè)硬連接
linkinfo — 獲取一個(gè)連接的信息
lstat — 給出一個(gè)文件或符號連接的信息
mkdir — 新建目錄
move_uploaded_file — 將上傳的文件移動到新位置
parse_ini_file — 解析一個(gè)配置文件
pathinfo — 返回文件路徑的信息
pclose — 關(guān)閉進(jìn)程文件指針
popen — 打開進(jìn)程文件指針
readfile — 輸出一個(gè)文件
readlink — 返回符號連接指向的目標(biāo)
realpath — 返回規(guī)范化的絕對路徑名
rename — 重命名一個(gè)文件或目錄
rewind — 倒回文件指針的位置
rmdir — 刪除目錄
set_file_buffer — stream_set_write_buffer() 的別名
stat — 給出文件的信息
symlink — 建立符號連接
tempnam — 建立一個(gè)具有唯一文件名的文件
tmpfile — 建立一個(gè)臨時(shí)文件
touch — 設(shè)定文件的訪問和修改時(shí)間
umask — 改變當(dāng)前的 umask
unlink — 刪除文件
mail — 發(fā)送郵件
abs — 絕對值
acos — 反余弦
acosh — 反雙曲余弦
asin — 反正弦
asinh — 反雙曲正弦
atan2 — 兩個(gè)參數(shù)的反正切
atan — 反正切
atanh — 反雙曲正切
base_convert — 在任意進(jìn)制之間轉(zhuǎn)換數(shù)字
bindec — 二進(jìn)制轉(zhuǎn)換為十進(jìn)制
ceil — 進(jìn)一法取整
cos — 余弦
cosh — 雙曲余弦
decbin — 十進(jìn)制轉(zhuǎn)換為二進(jìn)制
dechex — 十進(jìn)制轉(zhuǎn)換為十六進(jìn)制
decoct — 十進(jìn)制轉(zhuǎn)換為八進(jìn)制
deg2rad — 將角度轉(zhuǎn)換為弧度
exp — 計(jì)算 e 的指數(shù)
expm1 — 返回 exp(number) – 1,甚至當(dāng) number 的值接近零也能計(jì)算出準(zhǔn)確結(jié)果
floor — 舍去法取整
fmod — 返回除法的浮點(diǎn)數(shù)余數(shù)
getrandmax — 顯示隨機(jī)數(shù)最大的可能值
hexdec — 十六進(jìn)制轉(zhuǎn)換為十進(jìn)制
hypot — 計(jì)算一直角三角形的斜邊長度
is_finite — 判斷是否為有限值
is_infinite — 判斷是否為無限值
is_nan — 判斷是否為合法數(shù)值
lcg_value — 組合線性同余發(fā)生器
log10 — 以 10 為底的對數(shù)
log1p — 返回 log(1 + number),甚至當(dāng) number 的值接近零也能計(jì)算出準(zhǔn)確結(jié)果
log — 自然對數(shù)
max — 找出最大值
min — 找出最小值
mt_getrandmax — 顯示隨機(jī)數(shù)的最大可能值
mt_rand — 生成更好的隨機(jī)數(shù)
mt_srand — 播下一個(gè)更好的隨機(jī)數(shù)發(fā)生器種子
octdec — 八進(jìn)制轉(zhuǎn)換為十進(jìn)制
pi — 得到圓周率值
pow — 指數(shù)表達(dá)式
rad2deg — 將弧度數(shù)轉(zhuǎn)換為相應(yīng)的角度數(shù)
rand — 產(chǎn)生一個(gè)隨機(jī)整數(shù)
round — 對浮點(diǎn)數(shù)進(jìn)行四舍五入
sin — 正弦
sinh — 雙曲正弦
sqrt — 平方根
srand — 播下隨機(jī)數(shù)發(fā)生器種子
tan — 正切
tanh — 雙曲正切
mysql_affected_rows — 取得前一次 MySQL 操作所影響的記錄行數(shù)
mysql_change_user — 改變活動連接中登錄的用戶
mysql_client_encoding — 返回字符集的名稱
mysql_close — 關(guān)閉 MySQL 連接
mysql_connect — 打開一個(gè)到 MySQL 服務(wù)器的連接
mysql_create_db — 新建一個(gè) MySQL 數(shù)據(jù)庫
mysql_data_seek — 移動內(nèi)部結(jié)果的指針
mysql_db_name — 取得結(jié)果數(shù)據(jù)
mysql_db_query — 發(fā)送一條 MySQL 查詢
mysql_drop_db — 丟棄(刪除)一個(gè) MySQL 數(shù)據(jù)庫
mysql_errno — 返回上一個(gè) MySQL 操作中的錯(cuò)誤信息的數(shù)字編碼
mysql_error — 返回上一個(gè) MySQL 操作產(chǎn)生的文本錯(cuò)誤信息
mysql_escape_string — 轉(zhuǎn)義一個(gè)字符串用于 mysql_query
mysql_fetch_array — 從結(jié)果集中取得一行作為關(guān)聯(lián)數(shù)組,或數(shù)字?jǐn)?shù)組,或二者兼有
mysql_fetch_assoc — 從結(jié)果集中取得一行作為關(guān)聯(lián)數(shù)組
mysql_fetch_field — 從結(jié)果集中取得列信息并作為對象返回
mysql_fetch_lengths — 取得結(jié)果集中每個(gè)輸出的長度
mysql_fetch_object — 從結(jié)果集中取得一行作為對象
mysql_fetch_row — 從結(jié)果集中取得一行作為枚舉數(shù)組
mysql_field_flags — 從結(jié)果中取得和指定字段關(guān)聯(lián)的標(biāo)志
mysql_field_len — 返回指定字段的長度
mysql_field_name — 取得結(jié)果中指定字段的字段名
mysql_field_seek — 將結(jié)果集中的指針設(shè)定為制定的字段偏移量
mysql_field_table — 取得指定字段所在的表名
mysql_field_type — 取得結(jié)果集中指定字段的類型
mysql_free_result — 釋放結(jié)果內(nèi)存
mysql_get_client_info — 取得 MySQL 客戶端信息
mysql_get_host_info — 取得 MySQL 主機(jī)信息
mysql_get_proto_info — 取得 MySQL 協(xié)議信息
mysql_get_server_info — 取得 MySQL 服務(wù)器信息
mysql_info — 取得最近一條查詢的信息
mysql_insert_id — 取得上一步 INSERT 操作產(chǎn)生的 ID
mysql_list_dbs — 列出 MySQL 服務(wù)器中所有的數(shù)據(jù)庫
mysql_list_fields — 列出 MySQL 結(jié)果中的字段
mysql_list_processes — 列出 MySQL 進(jìn)程
mysql_list_tables — 列出 MySQL 數(shù)據(jù)庫中的表
mysql_num_fields — 取得結(jié)果集中字段的數(shù)目
mysql_num_rows — 取得結(jié)果集中行的數(shù)目
mysql_pconnect — 打開一個(gè)到 MySQL 服務(wù)器的持久連接
mysql_ping — Ping 一個(gè)服務(wù)器連接,如果沒有連接則重新連接
mysql_query — 發(fā)送一條 MySQL 查詢
mysql_real_escape_string — 轉(zhuǎn)義 SQL 語句中使用的字符串中的特殊字符,并考慮到連接的當(dāng)前字符集
mysql_result — 取得結(jié)果數(shù)據(jù)
mysql_select_db — 選擇 MySQL 數(shù)據(jù)庫
mysql_stat — 取得當(dāng)前系統(tǒng)狀態(tài)
mysql_tablename — 取得表名
mysql_thread_id — 返回當(dāng)前線程的 ID
mysql_unbuffered_query — 向 MySQL 發(fā)送一條 SQL 查詢,并不獲取和緩存結(jié)果的行
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 — 返回與模式匹配的數(shù)組單元
preg_last_error — Returns the error code of the last PCRE regex execution
preg_match_all — 進(jìn)行全局正則表達(dá)式匹配
preg_match — 進(jìn)行正則表達(dá)式匹配
preg_quote — 轉(zhuǎn)義正則表達(dá)式字符
preg_replace_callback — 用回調(diào)函數(shù)執(zhí)行正則表達(dá)式的搜索和替換
preg_replace — 執(zhí)行正則表達(dá)式的搜索和替換
preg_split — 用正則表達(dá)式分割字符串
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 — 將當(dāng)前會話數(shù)據(jù)編碼為一個(gè)字符串
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 — 正則表達(dá)式替換
ereg — 正則表達(dá)式匹配
eregi_replace — 不區(qū)分大小寫的正則表達(dá)式替換
eregi — 不區(qū)分大小寫的正則表達(dá)式匹配
split — 用正則表達(dá)式將字符串分割到數(shù)組中
spliti — 用正則表達(dá)式不區(qū)分大小寫將字符串分割到數(shù)組中
sql_regcase — 產(chǎn)生用于不區(qū)分大小的匹配的正則表達(dá)式
addcslashes — 以 C 語言風(fēng)格使用反斜線轉(zhuǎn)義字符串中的字符
addslashes — 使用反斜線引用字符串
bin2hex — 將二進(jìn)制數(shù)據(jù)轉(zhuǎn)換成十六進(jìn)制表示
chop — rtrim() 的別名
chr — 返回指定的字符
chunk_split — 將字符串分割成小塊
count_chars — 返回字符串所用字符的信息
crc32 — 計(jì)算一個(gè)字符串的 crc32 多項(xiàng)式
crypt — One-way string encryption (hashing)
echo — Output one or more strings
explode — 使用一個(gè)字符串分割另一個(gè)字符串
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 編碼的數(shù)據(jù)進(jìn)行解碼
base64_encode — 使用 MIME base64 對數(shù)據(jù)進(jìn)行編碼
get_headers — 取得服務(wù)器響應(yīng)一個(gè) HTTP 請求所發(fā)送的所有標(biāo)頭
get_meta_tags — 從一個(gè)文件中提取所有的 meta 標(biāo)簽 content 屬性,返回一個(gè)數(shù)組
http_build_query — 生成 URL-encode 之后的請求字符串
parse_url — 解析 URL,返回其組成部分
rawurldecode — 對已編碼的 URL 字符串進(jìn)行解碼
rawurlencode — 按照 RFC 1738 對 URL 進(jìn)行編碼
urldecode — 解碼已編碼的 URL 字符串
urlencode — 編碼 URL 字符串
debug_zval_dump — Dumps a string representation of an internal zend value to output
doubleval — floatval() 的別名
empty — 檢查一個(gè)變量是否為空
floatval — 獲取變量的浮點(diǎn)值
get_defined_vars — 返回由所有已定義變量所組成的數(shù)組
get_resource_type — 返回資源(resource)類型
gettype — 獲取變量的類型
import_request_variables — 將 GET/POST/Cookie 變量導(dǎo)入到全局作用域中
intval — 獲取變量的整數(shù)值
is_array — 檢測變量是否是數(shù)組
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 — 檢測參數(shù)是否為合法的可調(diào)用結(jié)構(gòu)
is_double — is_float() 的別名
is_float — 檢測變量是否是浮點(diǎn)型
is_int — 檢測變量是否是整數(shù)
is_integer — is_int() 的別名
is_long — is_int() 的別名
is_null — 檢測變量是否為 NULL
is_numeric — 檢測變量是否為數(shù)字或數(shù)字字符串
is_object — 檢測變量是否是一個(gè)對象
is_real — is_float() 的別名
is_resource — 檢測變量是否為資源類型
is_scalar — 檢測變量是否是一個(gè)標(biāo)量
is_string — 檢測變量是否是字符串
is_unicode — Finds whether a variable is a unicode string
isset — 檢測變量是否設(shè)置
print_r — 打印關(guān)于變量的易于理解的信息。
serialize — 產(chǎn)生一個(gè)可存儲的值的表示
settype — 設(shè)置變量的類型
strval — 獲取變量的字符串值
unserialize — 從已存儲的表示中創(chuàng)建 PHP 的值
unset — 釋放給定的變量
var_dump — 打印變量的相關(guān)信息
var_export — 輸出或返回一個(gè)變量的字符串表示

關(guān)于PHP有哪些常用的函數(shù)就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

php
AI