Home php教程 php手册 PHP String函数总结介绍

PHP String函数总结介绍

Jun 13, 2016 am 11:12 AM
h htmlentities php string for introduce function character Summarize Bundle Convert

PHP String函数之htmlentities() 函数把字符转换为 HTML 实体。

html_entity_decode() 函数把 HTML 实体转换为字符。

hebrevc() 函数把希伯来文本从右至左的流转换为左至右的流。它也会把新行 (n) 转换为

hebrev() 函数把希伯来文本从右至左的流转换为左至右的流。

get_html_translation_table() 函数返回被 htmlentities() 和 htmlspecialchars() 函数使用的翻译表。

fprintf() 函数把格式化的字符串写到指定的输出流(例如:文件或数据库)。

explode() 函数把字符串分割为数组。

PHP String函数之echo() 函数输出一个或多个字符串。

crypt() 函数返回使用 DES、Blowfish 或 MD5 加密的字符串。

crc32() 函数计算一个字符串的 crc32 多项式。

count_chars() 函数返回字符串所用字符的信息。

convert_uuencode() 函数使用 uuencode 算法对字符串进行编码。

PHP String函数之convert_uudecode() 函数对 uuencode 编码的字符串进行解码。

convert_cyr_string() 函数把字符由一种 Cyrillic 字符转换成另一种。

chunk_split() 函数把字符串分割为一连串更小的部分。

chr() 函数从指定的 ASCII 值返回字符。

chop() 函数从字符串的末端开始删除空白字符或其他预定义字符。

bin2hex() 函数把 ASCII 字符的字符串转换为十六进制值。

PHP String函数之addslashes() 函数在指定的预定义字符前添加反斜杠。

addcslashes() 函数在指定的字符前添加反斜杠。

xpath() 函数运行对 XML 文档的 XPath 查询。

simplexml_load_string() 函数把 XML 字符串载入对象中。

simplexml_load_file() 函数把 XML 文档载入对象中。

PHP String函数之simplexml_import_dom() 函数把 DOM 节点转换为 SimpleXMLElement 对象。

registerXPathNamespace() 函数为下一次 XPath 查询创建命名空间语境。

getNamespace() 函数获取在 XML 文档中使用的命名空间。

getName() 函数从 SimpleXMLElement 对象获取 XML 元素的名称。

getDocNamespaces() 函数从 SimpleXMLElement 对象返回在 XML 文档中声明的命名空间。

children() 函数获取指定节点的子节点。

attributes() 函数获取 SimpleXML 元素的属性。

PHP String函数之asXML() 函数以字符串的形式从 SimpleXMLElement 对象返回 XML 文档。

addChild() 函数向指定的 XML 节点添加一个子节点。

addAttribute() 函数给 SimpleXML 元素添加一个属性。

__construct() 函数创建一个新的 SimpleXMLElement 对象。

mysql_unbuffered_query() 函数向 MySQL 发送一条 SQL 查询(不获取 / 缓存结果)。

mysql_thread_id() 函数返回当前线程的 ID。

mysql_stat() 函数返回 MySQL 服务器的当前系统状态。

mysql_select_db() 函数设置活动的 MySQL 数据库。

PHP String函数之mysql_result() 函数返回结果集中一个字段的值。

mysql_real_escape_string() 函数转义 SQL 语句中使用的字符串中的特殊字符。

mysql_query() 函数执行一条 MySQL 查询。

mysql_ping() 函数 Ping 一个服务器连接,如果没有连接则重新连接。

mysql_pconnect() 函数打开一个到 MySQL 服务器的持久连接。

mysql_num_rows() 函数返回结果集中行的数目。

mysql_num_fields() 函数返回结果集中字段的数。

mysql_list_processes() 函数列出 MySQL 进程。

PHP String函数之mysql_list_dbs() 函数列出 MySQL 服务器中所有的数据库。

mysql_insert_id() 函数返回上一步 INSERT 操作产生的 ID。

mysql_info() 函数返回最近一条查询的信息。

mysql_get_server_info() 函数返回 MySQL 服务器的信息。

mysql_get_proto_info() 函数返回 MySQL 协议的信息。

mysql_get_host_info() 函数返回 MySQL 主机的信息。

PHP String函数之mysql_get_client_info() 函数返回 MySQL 客户端信息。

mysql_free_result() 函数释放结果内存。

mysql_field_type() 函数返回结果集中指定字段的类型。

mysql_field_table() 函数返回指定字段所在的表名。

mysql_field_seek() 函数将结果集中的指针设定为指定的字段偏移量。

mysql_field_name() 函数取得结果中指定字段的字段名。

mysql_field_len() 函数返回指定字段的长度。

PHP String函数之mysql_field_flags() 函数从结果中取得和指定字段关联的标志。

mysql_fetch_row() 函数从结果集中取得一行作为数字数组。

mysql_fetch_object() 函数从结果集(记录集)中取得一行作为对象。

mysql_fetch_lengths() 函数取得一行中每个字段的内容的长度。

mysql_fetch_field() 函数从结果集中取得列信息并作为对象返回。

mysql_fetch_assoc() 函数从结果集中取得一行作为关联数组。

PHP String函数之mysql_fetch_array() 函数从结果集中取得一行作为关联数组,或数字数组,或二者兼有

mysql_error() 函数返回上一个 MySQL 操作产生的文本错误信息。

mysql_errno() 函数返回上一个 MySQL 操作中的错误信息的数字编码。

mysql_db_name() 函数取得 mysql_list_dbs() 调用所返回的数据库名。

mysql_data_seek() 函数移动内部结果的指针。

mysql_connect() 函数打开非持久的 MySQL 连接。

mysql_close() 函数关闭非持久的 MySQL 连接。

mysql_client_encoding() 函数返回当前连接的字符集的名称。

PHP String函数之mysql_affected_rows() 函数返回前一次 MySQL 操作所影响的记录行数。

tanh() 函数返回双曲正切。

tan() 函数返回正切。

srand() 函数播下随机数发生器种子。

sqrt() 函数返回一个数的平方根。

PHP String函数之sinh() 函数返回一个数的双曲正弦。

sin() 函数返回一个数的正弦。

round() 函数对浮点数进行四舍五入。

rand() 函数返回随机整数。

rad2deg() 函数把弧度数转换为角度数。

PHP String函数之pow() 函数返回 x 的 y 次方。

pi() 函数返回圆周率的值。

octdec() 函数把八进制转换为十进制。

mt_srand() 播种 Mersenne Twister 随机数生成器。

mt_rand() 使用 Mersenne Twister 算法返回随机整数。

mt_getrandmax() 显示随机数的最大可能值。

min() 返回最小值。

max() 返回最大值。

PHP String函数之log1p() 以返回 log(1 + x),甚至当 x 的值接近零也能计算出准确结果。

log10() 以 10 为底的对数。

log() 返回自然对数。

lcg_value() 组合线性同余发生器。

is_nan() 判断是否为合法数值。

is_infinite() 判断是否为无限值。

is_finite() 函数判断是否为有限值。

hypot() 函数计算一直角三角形的斜边长度。

PHP String函数之hexdec() 函数把十六进制转换为十进制。

fmod() 函数显示随机数最大的可能值。

fmod() 函数返回除法的浮点数余数。

floor() 函数向下舍入为最接近的整数。

expm1() 函数返回 exp(x) - 1,甚至当 number 的值接近零也能计算出准确结果。

exp() 函数计算 e 的指数。

PHP String函数之deg2rad() 函数将角度转换为弧度。

decoct() 函数把十进制转换为八进制。

dechex() 函数把十进制转换为十六进制。

decbin() 函数把十进制转换为二进制。

cosh() 函数返回一个数的双曲余弦。

cos() 函数返回一个数的余弦。

ceil() 函数向上舍入为最接近的整数。

bindec() 函数把二进制转换为十进制。

base_convert() 函数在任意进制之间转换数字。

atanh() 函数返回一个角度的反双曲正切。

PHP String函数之atan() 和 atan2() 和 atan2() 函数


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1677
14
PHP Tutorial
1279
29
C# Tutorial
1257
24
The Continued Use of PHP: Reasons for Its Endurance The Continued Use of PHP: Reasons for Its Endurance Apr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

What happens if session_start() is called multiple times? What happens if session_start() is called multiple times? Apr 25, 2025 am 12:06 AM

Multiple calls to session_start() will result in warning messages and possible data overwrites. 1) PHP will issue a warning, prompting that the session has been started. 2) It may cause unexpected overwriting of session data. 3) Use session_status() to check the session status to avoid repeated calls.

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

What is the significance of the session_start() function? What is the significance of the session_start() function? May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

Composer: Aiding PHP Development Through AI Composer: Aiding PHP Development Through AI Apr 29, 2025 am 12:27 AM

AI can help optimize the use of Composer. Specific methods include: 1. Dependency management optimization: AI analyzes dependencies, recommends the best version combination, and reduces conflicts. 2. Automated code generation: AI generates composer.json files that conform to best practices. 3. Improve code quality: AI detects potential problems, provides optimization suggestions, and improves code quality. These methods are implemented through machine learning and natural language processing technologies to help developers improve efficiency and code quality.

Using Laravel: Streamlining Web Development with PHP Using Laravel: Streamlining Web Development with PHP Apr 19, 2025 am 12:18 AM

Laravel optimizes the web development process including: 1. Use the routing system to manage the URL structure; 2. Use the Blade template engine to simplify view development; 3. Handle time-consuming tasks through queues; 4. Use EloquentORM to simplify database operations; 5. Follow best practices to improve code quality and maintainability.

PHP and IIS: Making Them Work Together PHP and IIS: Making Them Work Together Apr 21, 2025 am 12:06 AM

Configuring and running PHP on IIS requires the following steps: 1) Download and install PHP, 2) Configuring IIS and adding FastCGI module, 3) Create and set up an application pool, 4) Create a website and bind to an application pool. Through these steps, you can easily deploy PHP applications on your Windows server and improve application stability and efficiency by configuring scaling and optimizing performance.

H5: Key Improvements in HTML5 H5: Key Improvements in HTML5 Apr 28, 2025 am 12:26 AM

HTML5 brings five key improvements: 1. Semantic tags improve code clarity and SEO effects; 2. Multimedia support simplifies video and audio embedding; 3. Form enhancement simplifies verification; 4. Offline and local storage improves user experience; 5. Canvas and graphics functions enhance the visualization of web pages.

See all articles