PHP trim() 函数
来源:互联网 发布:吴伯凡 知乎 编辑:程序博客网 时间:2024/06/05 05:34
PHP String 函数
定义和用法
trim() 函数从字符串的两端删除空白字符和其他预定义字符。
语法
trim(string,charlist)
- "\0" - NULL
- "\t" - tab
- "\n" - new line
- "\x0B" - 纵向列表符
- "\r" - 回车
- " " - 普通空白字符
例子
例子 1
<html><body><?php$str = " Hello World! ";echo "Without trim: " . $str;echo "<br />";echo "With trim: " . trim($str)
;?><body><html>
输出:
Without trim: Hello World!With trim: Hello World!
HTML 源码:
<html><body>Without trim: Hello World! <br />With trim: Hello World!</body></html>
例子 2
<?php$str = "\r\nHello World!\r\n";echo "Without trim: " . $str;echo "<br />";echo "With trim: " . trim($str)
;?>
输出:
Without trim: Hello World!With trim: Hello World!
HTML 源码:
<html><body>Without trim: Hello World!<br />With trim: Hello World!</body></html>
PHP String 函数
- PHP trim() 函数
- PHP trim() 函数
- php trim()函数
- PHP trim() 函数
- php trim()函数
- 【PHP函数】 trim()
- PHP函数之trim
- php trim()函数
- php 之trim函数
- php源码分析trim函数的实现
- PHP trim()函数的作用和使用方法
- php的trim函数遇到的问题
- PHP字符串函数-trim()实例用法
- php trim
- trim() 函数
- Trim 函数
- trim函数
- Trim()函数
- 十六、设计模式 之 命令模式
- CentOS6.2下源码安装openStack glance
- Android Widget 实例(世界杯倒计时)
- jQuery基础教程之强大的选择器(层次选择器)
- 【编程技巧】do...while(0)的妙用
- PHP trim() 函数
- java继承
- spring bean sope
- vc根据域名获取IP地址 gethostbyname()函数
- MFC CDC::GetPath
- Android之PopupWindow
- 常用位操作小技巧
- 如何在PreferenceActivity中加载普通控件及Preference
- quartz常见问题