note 51740 deleted from function.ereg by tularis
| From: | tularis@php.net | Date: | Thu, 31 May 2007 13:25:04 +0000 |
| Subject: | note 51740 deleted from function.ereg by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127073@lists.php.net to get a copy of this message | ||
Note Submitter: kitchen -at- script kitchen -dot- com
----
just to note here, php4's ereg() doesn't support [:space:], so if you want to match
arbitrary whitespace, use preg_match()
$string = "hi \t bob";
if (ereg("hi[:space:]*bob", $string)) {
print "you must be using php5!\n";
}
// php4 version
if (preg_match("/hi\s*bob/",$string)) {
print "works in both php4 and php5!\n";
}
php5's ereg() does support [:space:]