Error[8]: Undefined offset: 81, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述文章目录常用API1.字符串处理1.1.开启PHP扩展1.2.字符串处理函数2.数组处理3.时间处理4.文件 *** 作常用API任何编程语言本身并没有太多的能力,具体的能力大多数都来源于API。PHP的能力来源于它有1000+内置函数,不是每一个函数都默认直接可以使用,有一些

文章目录常用 API1. 字符串处理1.1. 开启 PHP 扩展1.2. 字符串处理函数2. 数组处理3. 时间处理4. 文件 *** 作

常用 API

任何编程语言本身并没有太多的能力,具体的能力大多数都来源于 API。

PHP 的能力来源于它有 1000+ 内置函数,不是每一个函数都默认直接可以使用,有一些需要安装或者启用额外的"插件" 扩展

1. 字符串处理

宽字符集需要开启 PHP_mbstring 扩展

1.1. 开启 PHP 扩展将PHP目录中的 PHP.ini-development 复制一个 修改为 PHP.ini修改扩展文件所在目录 extension_dir修改文件中的部分选项(; 是注释符)在 Apache 配置文件中申明一下 PHP.ini 的所在目录1.2. 字符串处理函数字符串截取
string substr ( string $string , int $start [, int $length ] )string mb_substr ( string $str , int $start [, int $length = NulL [, string $enCoding =mb_internal_enCoding() ]] )
字符串长度
int strlen ( string $string )mixed mb_strlen ( string $str [, string $enCoding = mb_internal_enCoding() ] )
大小写转换
string strtolower ( string $string ) string strtoupper ( string $string )

去除首尾空白字符

string trim ( string $str [, string $character_mask = " \t\n\rmixed strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )int mb_strpos ( string $haystack , string $needle [, int $offset = 0 [, string $enCoding =mb_internal_enCoding() ]] )\x0B" ] ) string ltrim ( string $str [, string $character_mask ] )string rtrim ( string $str [, string $character_mask ] )
查找字符串中某些字符首次出现位置
mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
字符串替换
string str_repeat ( string $input , int $multiplIEr )
重复字符串
array explode( string $input, string $char )
字符串分割
array_keys() / array_values()
2. 数组处理获取关联数组中全部的键 / 值
array_key_exists()
判断关联数组中是否存在某个键
array_unique()
去除重复的元素
array_push()$arr[] = 'new value'
将一个或多个元素追加到数组中
array_pop()
删除数组中最后一个元素
count()
数组长度
in_array()
检测存在
函数
3. 时间处理时间戳: time()

从 Unix 纪元(格林威治时间 1970-01-01 00:00:00)到当前时间的秒数

格式化日期: date()

获取有格式的当前时间

格式化一个指定的时间戳

可以通过 strtotime() 将有格式的时间字符串转换为时间戳

4. 文件 *** 作[+++]
描述PHPbasename()
返回路径中的文件名部分。3copy()
复制文件。3dirname()
返回路径中的目录名称部分。3disk_free_space()
返回目录的可用空间。4disk_total_space()
返回一个目录的磁盘总容量。4fclose()
关闭打开的文件。3file()
把文件读入一个数组中。3file_exists()
检查文件或目录是否存在。3file_get_contents()
将文件读入字符串。4file_put_contents()
将字符串写入文件。5filesize()
返回文件大小。3fopen()
打开一个文件或 URL。3glob()
返回一个包含匹配指定模式的文件名/目录的数组。4is_dir()
判断指定的文件名是否是一个目录。3is_file()
判断指定文件是否为常规的文件。3mkdir()
创建目录。3move_uploaded_file()
将上传的文件移动到新位置。4pathinfo()
返回关于文件路径的信息。4rename()
重名名文件或目录。3rmdir()
删除空的目录。3unlink()
删除文件。3

参考:http://www.w3school.com.cn/php/php_ref_filesystem.asp

总结

以上是内存溢出为你收集整理的PHP常用 API全部内容,希望文章能够帮你解决PHP常用 API所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
PHP常用 API_PHP_内存溢出

PHP常用 API

PHP常用 API,第1张

概述文章目录常用API1.字符串处理1.1.开启PHP扩展1.2.字符串处理函数2.数组处理3.时间处理4.文件 *** 作常用API任何编程语言本身并没有太多的能力,具体的能力大多数都来源于API。PHP的能力来源于它有1000+内置函数,不是每一个函数都默认直接可以使用,有一些

文章目录常用 API1. 字符串处理1.1. 开启 PHP 扩展1.2. 字符串处理函数2. 数组处理3. 时间处理4. 文件 *** 作

常用 API

任何编程语言本身并没有太多的能力,具体的能力大多数都来源于 API。

PHP 的能力来源于它有 1000+ 内置函数,不是每一个函数都默认直接可以使用,有一些需要安装或者启用额外的"插件" 扩展

1. 字符串处理

宽字符集需要开启 PHP_mbstring 扩展

1.1. 开启 PHP 扩展将PHP目录中的 PHP.ini-development 复制一个 修改为 PHP.ini修改扩展文件所在目录 extension_dir修改文件中的部分选项(; 是注释符)在 Apache 配置文件中申明一下 PHP.ini 的所在目录1.2. 字符串处理函数字符串截取
string substr ( string $string , int $start [, int $length ] )string mb_substr ( string $str , int $start [, int $length = NulL [, string $enCoding =mb_internal_enCoding() ]] )
字符串长度
int strlen ( string $string )mixed mb_strlen ( string $str [, string $enCoding = mb_internal_enCoding() ] )
大小写转换
string strtolower ( string $string ) string strtoupper ( string $string )

去除首尾空白字符

string trim ( string $str [, string $character_mask = " \t\n\rmixed strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )int mb_strpos ( string $haystack , string $needle [, int $offset = 0 [, string $enCoding =mb_internal_enCoding() ]] )\x0B" ] ) string ltrim ( string $str [, string $character_mask ] )string rtrim ( string $str [, string $character_mask ] )
查找字符串中某些字符首次出现位置
mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
字符串替换
string str_repeat ( string $input , int $multiplIEr )
重复字符串
array explode( string $input, string $char )
字符串分割
array_keys() / array_values()
2. 数组处理获取关联数组中全部的键 / 值
array_key_exists()
判断关联数组中是否存在某个键
array_unique()
去除重复的元素
array_push()$arr[] = 'new value'
将一个或多个元素追加到数组中
array_pop()
删除数组中最后一个元素
count()
数组长度
in_array()
检测存在
函数
3. 时间处理时间戳: time()

从 Unix 纪元(格林威治时间 1970-01-01 00:00:00)到当前时间的秒数

格式化日期: date()

获取有格式的当前时间

格式化一个指定的时间戳

可以通过 strtotime() 将有格式的时间字符串转换为时间戳

4. 文件 *** 作
描述PHPbasename()
返回路径中的文件名部分。3copy()
复制文件。3dirname()
返回路径中的目录名称部分。3disk_free_space()
返回目录的可用空间。4disk_total_space()
返回一个目录的磁盘总容量。4fclose()
关闭打开的文件。3file()
把文件读入一个数组中。3file_exists()
检查文件或目录是否存在。3file_get_contents()
将文件读入字符串。4file_put_contents()
将字符串写入文件。5filesize()
返回文件大小。3fopen()
打开一个文件或 URL。3glob()
返回一个包含匹配指定模式的文件名/目录的数组。4is_dir()
判断指定的文件名是否是一个目录。3is_file()
判断指定文件是否为常规的文件。3mkdir()
创建目录。3move_uploaded_file()
将上传的文件移动到新位置。4pathinfo()
返回关于文件路径的信息。4rename()
重名名文件或目录。3rmdir()
删除空的目录。3unlink()
删除文件。3

参考:http://www.w3school.com.cn/php/php_ref_filesystem.asp

总结

以上是内存溢出为你收集整理的PHP常用 API全部内容,希望文章能够帮你解决PHP常用 API所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1015049.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存