重写PHP的explode办法
2015-10-25 08:37
513 查看
function rexplode($delimiter, $str){ $d_len = strlen($delimiter); $arr = array(); $i = $pos = 0; while (false !== ($pos = stripos($str.$delimiter, $delimiter, $pos)) ) { $arr[] = mb_substr($str, $i, $pos-$i); $i = $pos + $d_len; $pos += $d_len; } return array_filter($arr); }
相关文章推荐
- xml文档PHP查询代码(学习使用)
- Ubuntu14 下安装laravel 空白修改方法
- 编写不受魔术引号影响的php应用
- 解决PhpStorm不能自动提示父类的方法的问题
- Mac OX 10.11 安装XAMPP+cakePHP
- ShortestPath:Six Degrees of Cowvin Bacon(POJ 2139)
- PHP7:10件事情你需要知道的
- PHP命名空间规则解析及高级功能3
- PHP命名空间规则解析及高级功能
- PHP中的命名空间(namespace)及其使用详解
- win10下80端口占用解决方案
- laravel 视图组件
- rtp协议分析
- PHP与最丑的后台管理系统
- php中双$$与多$$
- php引用传值
- php.ini 核心配置选项说明
- PHP 7 vs HHVM 比较
- Yii2的深入学习--别名(Aliases)
- PHP 函数ignore_user_abort ()