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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -