//实例一
代码如下 | 复制代码 |
$string="i am abc"; if (ereg ("www.111cn.net", $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.111cn.net>test</a>", $string); |
时间: 2024-11-29 15:18:10