this should work

$contents = str_replace("<?xml version=\"1.0\"?>", "", $contents);

btw. a welformed xml documented uses a space between "1.0" and ?>

> -----Original Message-----
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, February 10, 2002 11:07 PM
> To: 'Steven Jarvis'; [EMAIL PROTECTED]
> Subject: RE: [PHP] escaping ?>
> 
> 
> what about this?
> 
> $contents = str_replace('<?xml version="1.0"?'.'>', '', $contents);
> 
> 
> -----Original Message-----
> From: Steven Jarvis [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 09, 2002 8:46 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] escaping ?>
> 
> 
> I'm trying to do some string replaces on XML files to import 
> them into a 
> prprietary db that doesn't understand XML.
> 
> I need to strip the XML tags out of the file.
> 
> However, when I use this line:
> 
> $contents = str_replace('<?xml version="1.0"?>', '', $contents);
> 
> The ?> in the string ends my php block.
> 
> 
> I know there's an easy answer to this, and I'm probably just 
> suffering 
> from Friday afternoon burnout, but can someone let me know 
> how to escape 
> those so that I can search for them in the string?
> 
> thanks,
> 
> Steven
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

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

Reply via email to