2011-08-22 43 views
-1

可能重复:
Converting ereg expressions to preg如何将eregi替换为preg_match?

我想改变用的preg_match这条线,但它没有工作。

if ($file != "." && $file != ".." && !eregi(".jpg".$thumbext."$",$file) && eregi(".jpg$",$file)){ 

我想:

if ($file != "." && $file != ".." && !preg_match(".jpg".$thumbext."$",$file) && preg_match(".jpg$",$file)){ 

应该如何?

谢谢!

+0

您可能需要向我们展示了什么是'$ thumbtext' – Paulpro

回答

1

预浸需要分隔符:

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

得益于它完美的作品! –

相关问题