----- Original Message -----
From: "skate" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 06, 2003 3:16 PM
Subject: [PHP] greedy preg


>
>   $contents = preg_replace( "|<item>.*?$file.*?</item>|si", "",
$contents );
>
> it's being run on an XML file, where each entry is <item>......</item>
with
> a $file pointer in there.
>
> it works okay, except for the fact that it deletes that record, and every
> record before it. i can't figure out why it's being greedy? i know i gotta
> be missing something real simple...

You cannot store file pointers.  If you output the variable it's going to
look something like "Resource ID #1" which is meaningless except to the
instance of the script that created it.  Or did you mean something different
by "$file pointer"?

- Kevin



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to