收藏本站 收藏本站
积木网首页 - 软件测试 - 常用手册 - 站长工具 - 技术社区
首页 > PHP > PHP函数库 > 正文

首页 - PHP - 数据库 - 操作系统 - 游戏开发 - JS - Android - MySql - Redis - MongoDB - Win8 - Shell编程 - DOS命令 - jQuery - CSS样式 - Python - Perl

Access - Oracle - DB2 - SQLServer - MsSql2008 - MsSql2005 - Sqlite - PostgreSQL - node.js - extjs - JavaScript vbs - Powershell - Ruby

PHP技巧 - PHP基础 - PHP实例 - PHP字符串 - PHP数据库函数 - Mysql函数 - PDO类库 - PHP错误处理 - PHP选项 - PHP函数库 - PHP数学函数 - PHP数组

PHP:eregi_replace()的用法_Regex正则函数

eregi_replace

(PHP 4, PHP 5)

eregi_replace — 不区分大小写的正则表达式替换

说明

string eregi_replace ( string $pattern , string $replacement , string $string )

本函数和 ereg_replace() 完全相同,只除了在匹配字母字符时忽略大小写的区别。

Example #1 高亮搜索结果

<?php
$pattern = '(>[^<]*)('. quotemeta($_GET['search']) .')';
$replacement = '\1<span class="search">\2</span>';
$body = eregi_replace($pattern, $replacement, $body);
?>

参见 ereg(),eregi() 和 ereg_replace()。

PHP:spliti()的用法_Regex正则函数
spliti(PHP4=4.0.1,PHP5)spliti用正则表达式不区分大小写将字符串分割到数组中说明arrayspliti(string$pattern,string$string[,int$limit=-1])用正则表达式将一个string分割成

PHP:ereg_replace()的用法_Regex正则函数
ereg_replace(PHP4,PHP5)ereg_replace正则表达式替换说明stringereg_replace(string$pattern,string$replacement,string$string)本函数在string中扫描与pattern匹配的部分,并将其替换

PHP:preg_replace()的用法_PCRE正则函数
preg_replace(PHP4,PHP5)preg_replace执行一个正则表达式的搜索和替换说明mixedpreg_replace(mixed$pattern,mixed$replacement,mixed$subject[,int$limit=-1[,int&$count]])搜索subject中匹配

本周排行

更新排行

强悍的草根IT技术社区,这里应该有您想要的!
Copyright © 2010 Gimoo.Net. All Rights Rreserved  京ICP备05050695号