Re: Parsing XML CDF format in PHP3 - Stumbling over <?
| From: | David Robley | Date: | Fri, 30 Mar 2001 05:26:48 +0000 |
| Subject: | Re: Parsing XML CDF format in PHP3 - Stumbling over <? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46227@lists.php.net to get a copy of this message | ||
On Fri, 30 Mar 2001 14:34, Mike Gifford wrote:
> Hello,
>
> For some reason I am now having real difficulties removing and parsing
> some XML files. I think that if I can just strip out the <? & ?> that
> I should be able to parse the XML (.CDF) file. This should do it:
> $pagetext = eregi_replace('<?','',$pagetext);
> $pagetext = eregi_replace('?>','',$pagetext);
>
> I've attached the whole CDF file at the bottom of this message.
> However, I think that the following should strip out the offending part
> as well: $pagetext = eregi_replace('.*/TITLE>','',$pagetext);
>
> Unfortunately, for some reason it just isn't working for me. I have
> other scripts working just fine using similar code (on the same page).
> However, this just isn't working for me today.
>
> Any suggestions on what I'm overlooking would be great.
>
> Mike
I'm no regex guru but isn't the ? a special character? Try using
str_replace instead; it should be quicker also.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA