PHP过滤字符串的具体方法介绍
我们都知道
PHP过滤字符串的的代码示例:
- < ?php
 - nl2br();
 - // n to <br/>
 - addslashes(); stripslashes();
 - //对数据库操作时,转义特殊字符
 - chop();
 - //除去字符串右边空格
 - trim();
 - //除去字符串中所有空格
 - ltrim();
 - //除去字符串左边空格
 - htmlspecialchars();
 - //转换$,",<,>为相应的html实体
 - htmlentities();
 - //转换所有html标记为相应的html实体
 - array explode(string separator, string str);
 - //分割字符串
 - string implode(string separator, array arr);
 - //连接字符串
 - strtoupper(); strtolower();
 - //转换大小写
 - ucfirst();
 - //只转换第一个字符为大写
 - ucwords();
 - //转换每个words的第一个字母为大写
 - ?>
 
希望大家通过本文介绍的PHP过滤字符串的方法能够深入掌握这一知识点。
本文地址:http://www.phprm.com/frame/php1003735.html
转载随意,但请附上文章地址:-)