首页 > 作文

PHP trim()函数详解

更新时间:2023-04-08 11:05:01 阅读: 评论:0

定义

trim – 去除字符串里的空白符及其他指定字符

strip whitespace (or other characters) from the beginning and end减肥日记 of a string

描述

trim ( string $str [, string $character_mask = " \t\n\r
trim ( string $str [, string $character_mask = " \t\n\r\0\x0b" ] ) : string
\x0b" ] ) : string

参数 character_mask 可指定任意字符,使用..可指定一个范围
默认去除下面五个字符

” ” (ascii 32 (0x20)), an ordinary space – 普通空白符.“\t” (ascii 9 (0x09)), a tab – 二级英语制函数的有界性表符.“\n” (ascii 10 (0x0a)), a new line (line feed) – 换行符.“\r” (ascii 13 (0x0d)), a carriage return – 回车符.“\0” (ascii 0 (0x00)), the nul-byte.“\x0b” (ascii 11 (0x0b)), a vertical tab – 垂直制表符.

示例

trim($text, " \t.");trim($hello, "hdle");// (from 0 to 31 inclusive)trim中国最西边美乳方法($binary, "\x00..\x1f");

参看

类似函数,ltrim(),rtrim()

本文发布于:2023-04-08 11:04:59,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/f12dd5f20fe72b4a53377e8987fdab6a.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:PHP trim()函数详解.doc

本文 PDF 下载地址:PHP trim()函数详解.pdf

标签:字符   函数   制表符   空白
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图