how to replace eregi to preg_match? [duplicate]
-
08-01-2021 - |
Domanda
Possible Duplicate:
Converting ereg expressions to preg
I want to change this line with preg_match but it doesn't works.
if ($file != "." && $file != ".." && !eregi(".jpg".$thumbext."$",$file) && eregi(".jpg$",$file)){
I tried:
if ($file != "." && $file != ".." && !preg_match(".jpg".$thumbext."$",$file) && preg_match(".jpg$",$file)){
How it should be?
Thanks!
Soluzione
preg requires delimiters:
preg_match('/.jpg'.$thumbex.'$/',$ile)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow