Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<eregeregi>
Last updated: Tue, 19 Sep 2006

eregi_replace

(PHP 3, PHP 4, PHP 5)

eregi_replace -- Replace regular expression case insensitive

Description

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

This function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.

Example 1. Highlight search results

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

See also ereg(), eregi(), and ereg_replace().




<eregeregi>
Last updated: Tue, 19 Sep 2006