note 86429 deleted from function.mb-ereg-match by cmb
| From: | cmb@php.net | Date: | Thu, 11 Nov 2021 11:02:32 +0000 |
| Subject: | note 86429 deleted from function.mb-ereg-match by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217184@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
Note that this function matches a string from the beginning only (though not necessarily till the
end):
<?php
$test = mb_ereg_match("a", "some apples"); // returns false
$test = mb_ereg_match("a", "a kiwi"); // returns true
?>
If you want to check for a match anywhere in the string, use the wild-card & repeat operators .*
<?php
$test = mb_ereg_match(".*a", "some apples"); // returns true
?>