您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP4用户手册:函数-trim_PHP

2025/11/4 3:21:59发布5次查看
手册
table border=0 cellpadding=0 cellspacing=0 height=100% width=100%>
(php 3, php 4 >= 4.0.0)
trim -- 去除一个字符串开始和结尾的空白
描述
string trim (string str [, string charlist])
注意:第二个参数用在php 4.1.0
这个函数返回str字符串被去除首尾空白后的新字符串。不带第二个参数trim() 将去除下列字符:
(ascii 32 (0x20)), 空格;
\t (ascii 9 (0x09)), 制表符;
\n (ascii 10 (0x0a)), 换行符;
\r (ascii 13 (0x0d)), 回车符;
\0 (ascii 0 (0x00)), 空字符;
\x0b (ascii 11 (0x0b)), 垂直制表符。
你可以通过charlist参数指定你想去除的字符。simply list all characters that you want to be stripped. with .. you can specify a range of characters.
例1. trim()例子
参见ltrim()和rtrim().
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product