-1

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!

Community
  • 1
  • 1
dr.linux
  • 752
  • 5
  • 15
  • 37

1 Answers1

1

preg requires delimiters:

preg_match('/.jpg'.$thumbex.'$/',$ile)
Paul
  • 139,544
  • 27
  • 275
  • 264
Marc B
  • 356,200
  • 43
  • 426
  • 500