Re: Re: Running PHP Function from ECHO'd MySQL Data

From: Date: Fri, 23 Nov 2001 19:04:07 +0000
Subject: Re: Re: Running PHP Function from ECHO'd MySQL Data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-75601@lists.php.net to get a copy of this message
eval() is your friend - but be careful with it. Erik J. Barzeski wrote:
Hi, I've come upon a stumbling block and I'd like to resolve it the best way. I could probably think of a few work-arounds, but I'd rather not hack it if there's an elegant solution... I have a function, let's call it "do_stuff" that I include() in my head.inc file, which every page on the site include()s. So the function is available. Now, I have a bunch of articles in a MySQL database. The article "body" (a blob) has minimal HTML, like <p> and </b> and so on. It also contains stuff like this: <?=do_stuff("item1.jpg", "something else here");?> Now... How can I get PHP to process these commands? Obviously echo is not the way to go, since that's post-processing... What's the most elegant solution? Please email me off-list as I get the digest and won't see any answers for quite some time. Feel free as always to CC the list of course. P.S. I looked around quickly and didn't find the solution, so yes, this email to the list is pretty early in my "research" stage. Thanks!


« previous php.general (#75601) next »