What is the difference between eregreplace() and eregireplace()?
Hi all,
In PHP,
ereg_replace ? Replace regular expression case sensitive.
eregi_replace ? Replace regular expression case insensitive.
Example of ereg_replace :
<?php
$lastname = 'Kumar';
$string = "This is deepak singh.";
$string = ereg_replace('singh', $lastname, $string);
echo $string; /* Output: 'This is deepak kumar.' */
?>
Example of eregi_replace :
<?php
$string = "Hi this is deepak.";
print "Output :" .
eregi_replace("DEEPAK", "Kumar", $string);
/* Output: 'Hi this is Kumar.' */
?>
eregireplace() is case insensitive, while eregreplace() is not.
Thanks