开发者

how to replace eregi to preg_match? [duplicate]

This question already has answers here: Closed 11 years ago.

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!


preg requires delimiters:

preg_match('/.jpg'.$thumbex.'$/',$ile)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜