note 96830 modified in function.preg-match by thiago
| From: | thiago@php.net | Date: | Thu, 18 Mar 2010 02:38:05 +0000 |
| Subject: | note 96830 modified in function.preg-match by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-167156@lists.php.net to get a copy of this message | ||
for those coming over from ereg, preg_match can be quite intimidating. to get started here is a
migration tip.
<?php
if(ereg('[^0-9A-Za-z]',$test_string)) // will be true if characters arnt 0-9, A-Z or a-z.
if(preg_match('/[^0-9A-Za-z]/',$test_string)) // this is the preg_match version. the
/'s are now required.
?>
--was--
for those coming over from ereg, preg_match can be quite intimidating. to get started here is a
migration tip.
if(ereg('[^0-9A-Za-z]',$test_string)) // will be true if characters arnt 0-9, A-Z or a-z.
if(preg_match('/[^0-9A-Za-z]/',$test_string)) // this is the preg_match version. the
/'s are now required.
http://php.net/manual/en/function.preg-match.php