//实例一
$string="i am abc";
if (ereg ("www.zzarea.com", $string)) echo "'abc' is true <p>";
if (ereg ("^abc", $string)) echo "'^abc' is true <p>";
if (ereg ("abc$", $string)) echo "'abc$' is true";//实例二
$string = "this is a test. that is another test.";
echo ereg_replace (" is", " was", $string)."<p>";
echo ereg_replace (" is", "<b> is</b>", $string)."<p>";
echo ereg_replace ("test", "<a href=http://www.zzarea.com>test</a>", $string);
loading