开发者

how to replace eregi to preg_match? [duplicate]

开发者 https://www.devze.com 2023-03-30 11:59 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Converting ereg expressions to preg
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

精彩评论

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

关注公众号