|
Posted by Sander Tekelenburg on 07/24/07 17:59
Situation: I store news articles as individual PHP files. Each file
contains HTML and now and then some embedded PHP snippets.
Serving those news articles on the Web works fine, through include().
But I want to also serve them through RSS, and found that in that case
the PHP source code is served -- it's not being evaluated.
So it seems obvious that I need to first evaluate those PHP snippets,
store the result in a variable, and use *that* as the input for the RSS
generator script. I thought that'd be pretty straight-forward, but for
the life of me I can't figure out how to do it.
I've experimented with eval() and ob_start() but either I misunderstand
how to use them, or they're not the right tools for this use.
<http://de.php.net/manual/en/function.eval.php#76339> claims a solution,
but it doesn't work for me. (I get no output whatsover using that
approach.)
Any suggestions? TIA!
--
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
Mac user: "Macs only have 40 viruses, tops!"
PC user: "SEE! Not even the virus writers support Macs!"
Navigation:
[Reply to this message]
|