Re: Parsing PHP variables in XML document
| From: | Ivan Nedialkov | Date: | Sun, 26 Feb 2006 20:58:40 +0000 |
| Subject: | Re: Parsing PHP variables in XML document | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231113@lists.php.net to get a copy of this message | ||
Well isn't there a way instead of using only variables, to use sth like
<?php echo $foo; ?>
I tried it but it doesnt work
The parser returns blank!
On Sun, 2006-02-26 at 12:02 +0100, Bogdan Ribic wrote:
> Hmmm, come to think of it, it would only work if short_open_tags ini
> directive is turned OFF, which in most cases it won't be :(
>
> Bogdan Ribic wrote:
> > Hi Ivan,
> >
> > You might be able to use output buffering in conjunction with
> > including your xml file. Something like:
> >
> > ob_start();
> > include $xml_file;
> > $content = ob_end_flush();
> >
> > and then parse the $content string. If you are doing this from within
> > a function and you want access to global variables, you should import
> > all global variables first, via extract($GLOBALS);
> >
> > Btw, this is just an idea, and untested - use at your own risk :)
> >
> > Boban.
>
>
>
>