-1

I have run several searches here as well as on Google, but can't quite figure out what the proper syntax is to fix the following three lines to use preg_replace instead of eregi_replace. Help?

$regexp_search = 'width=".{3}"';
$regexp_replace = 'width="'.$autotube_size.'"';
$autostart = eregi_replace($regexp_search, $regexp_replace, $link);
Rob
  • 33
  • 3
  • 8

2 Answers2

0

For that simple pattern just add delimiters and i modifier:

$regexp_search = '/width=".{3}"/i';
AbraCadaver
  • 78,200
  • 7
  • 66
  • 87
0

Try this regex wizard... http://www.monstaregex.com

Also has a good tutorial if you're unfamiliar with regex.

Daniel Williams
  • 2,195
  • 7
  • 32
  • 53