What are the possible values of $file? Are you looking to replace just a specific occurance of a $file between <item> tags? Maybe this will help:
$contents = preg_replace("|<item>[^<]*$file[^<]*</item>|si","",$contents);
or just use the 'U' modifier for "ungreedy"...
i'm looking to replace the entire <item>....</item> for that respective file.
the file will have a value of whichever file that record points to, and will be unique (xml/news/12312312.xml)
should .*? not be ungreedy tho?
Yeah, it should be. What kind on content can be around $file and also within the <item> tag?
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php