preg match - Replace old eregi function PHP -
i'm having problems fix old php eregi funxtion becouse uses in parameter.. it's script captcha generation class_log.php matthieu mary
old code:
$smotif = "--$sin ([a-za-z0-9]{3,4},)*([a-za-z0-9]{3,4}){1}"; if ((eregi("$smotif ",$this->sparam))||(eregi("$smotif$",$this->sparam))){ $this->aparam['bextension'] = true; $this->aparam['aextension'] = $this->_param_get_extension($sin); $this->aparam['inextension'] = ($sin=='e'); $this->aparam['iparameters']++; }
i try this, not sure correct?
$smotif = "/--$sin ([a-za-z0-9]{3,4},)*([a-za-z0-9]{3,4}){1}/i"; if ((preg_match("$smotif ",$this->sparam))||(eregi("$smotif$",$this->sparam))){ $this->aparam['bextension'] = true; $this->aparam['aextension'] = $this->_param_get_extension($sin); $this->aparam['inextension'] = ($sin=='e'); $this->aparam['iparameters']++; }
tnx
here way i'd job:
$smotif = "/--$sin ([a-za-z0-9]{3,4},)*([a-za-z0-9]{3,4}) ?/"; if ( preg_match($smotif,$this->sparam)) {
Comments
Post a Comment