str_replace函数应用
2015-12-14 22:20
239 查看
<?php //mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] ) //在$subject中用$replace替换$search ,最后返回替换后的字符串和[替换的次数]; $str='This is a test , This is a real test , hello world'; $str=str_replace('test', 'show time', $str, $count); echo $str; //输出替换后的字符串 This is a show time , This is a real show time , hello world echo '<hr/>'; echo $count; //输出被替换的次数 2 ?>
相关文章推荐
- 小泡最漂亮最好了
- 列表
- zzulioj 1807: 小明在努力 (机智递归)
- 小项目集锦博客目录(不断更新,总结)
- 【Android】在浏览器中打开url链接,打开Service,复习IntDef
- POJ 1474 Video Surveillance (半平面交判断)
- 总结:数据库连接字符串的使用方法
- iOS开发之UICollectionView
- 项目开发技巧之开发文档建立
- project euler 82
- 使用GestureOverlayView控件实现手势识别
- Java多线程总结(2) — 线程生命周期中常用方法
- Struts2的输入验证
- Struts2的输入验证
- 集群-基础知识3
- 大话设计模式 笔记1——简单工厂模式
- 《java多线程编程核心技术》之Timer
- cuda core和sp
- 4-3 简单求和
- Android Studio 常用快捷键