Chinaunix首页 | 论坛 | 博客
  • 博客访问: 161100
  • 博文数量: 52
  • 博客积分: 2295
  • 博客等级: 大尉
  • 技术积分: 540
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-22 17:42
文章分类

全部博文(52)

文章存档

2013年(1)

2012年(11)

2011年(1)

2010年(31)

2009年(8)

我的朋友

分类:

2010-01-18 23:38:59

rtrim()函数的作用是:去除字符串末尾的空白(或其它字符)。
语法
rtrim(string,charlist)
Parameter参数 Description描述
string Required. Specifies the string to check
必要参数。指定字符串对象
charlist Optional. Specifies which characters to remove from the string. If omitted, all of the following characters are removed:
可选参数。指定需要从指定的字符串中删掉那些字符。如果忽略该参数,那么下列所有的字符将都被删除:
  • "/0" - NULL
    "/0" – NULL(空值)
  • "/t" - tab
    "/t" – tab(制表符)
  • "/n" - new line
    "/n" –new line(新行)
  • "/x0B" - vertical tab
    "/x0B" – vertical tab(垂直制表符)
  • "/r" - carriage return
    "/r" –carriage return(回车)
  • " " - ordinary white space
    " " –ordinary white space(空格)

 

 

$str = 'AAAAB B';
echo rtrim($str, ' B'),'
';

$str = 'AAAAB BC';
echo rtrim($str, ' BC'),'
';

?>

都打印出AAAA,因为第二个参数的意思是从指定的字符串中删掉那些字符。

阅读(1673) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~