Re: [PHP] reg exp matching/replacing

2002-10-03 Thread Jason D
Jen, Don't use eregi_replace when str_replace will do. $contents = str_replace($matches[0][$i], $blah, $contents); Also the dots should be escaped or gif and jpg without dots before them will be matched. preg_match_all('{\/*[A-z0-9_/-]+(\.gif|\.jpg)}', $contents, $matches);

[PHP] reg exp matching/replacing

2002-10-02 Thread Jennifer Swofford
I'm getting much closer to achieving my goal here. Now, I'm missing yet one more element. Here is my code: -- $filename = newexample.html; $fd = fopen ($filename, r); $contents = fread ($fd, filesize ($filename)); preg_match_all('{\/*[A-z0-9_/-]+(.gif|.jpg)}', $contents, $matches);