Php 如何将eregi替换为preg_match?
可能重复:Php 如何将eregi替换为preg_match?,php,preg-match,eregi,Php,Preg Match,Eregi,可能重复: 我想用preg_match更改这一行,但它不起作用 if ($file != "." && $file != ".." && !eregi(".jpg".$thumbext."$",$file) && eregi(".jpg$",$file)){ 我试过: if ($file != "." && $file != ".." && !preg_match(".jpg".$thumbext."$",$fi
我想用preg_match更改这一行,但它不起作用
if ($file != "." && $file != ".." && !eregi(".jpg".$thumbext."$",$file) && eregi(".jpg$",$file)){
我试过:
if ($file != "." && $file != ".." && !preg_match(".jpg".$thumbext."$",$file) && preg_match(".jpg$",$file)){
应该怎样
谢谢 preg需要分隔符:
preg_match('/.jpg'.$thumbex.'$/',$ile)
您可能需要向我们展示
$thumbtext
中的内容,谢谢,它工作得非常好!