Re: Running php code inside of a string within a phpscript..

From: Date: Fri, 02 Mar 2001 18:20:24 +0000
Subject: Re: Running php code inside of a string within a phpscript..
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-42376@lists.php.net to get a copy of this message
Hey, Aviv Revach wrote: > At 14:29 02/03/01 -0300, Lucas Persona wrote: > >Aviv Revach wrote: > > > How can I make those php3 commands to work as they supposed to? > > Take a look at the eval() function > >http://www.php.net/manual/en/function.eval.php > > Actually it doesn't. My string does not(!!) contains only php code. > It contains HTML tags, text, and php code (called with <?php ?>). I don't know any real function that does it...others could know something more about this, but if nothing is presented to you, you could do something like: - get all the '<?php' '?>' tags' position and separe them from the other code (that will be HTML); - you will have two things (could be an array of data). One is all the php code and the other is the HTML code; If you create a bidimensional array you can create a sequence of php and html code, or better than that, create a vector that will have the Data Type (HTML or PHP) and the value (the code) - Then, for each row or field of you array/vector , you check if it is php code (then use eval) or HTML (then use echo). Hope this helps, -- Lucas Persona ICQ #17635618 lpersona@widesoft.com.br +55 19 451 6300 ------------------------------------------------------- Widesoft Sistemas Ltda http://www.widesoft.com.br

« previous php.general (#42376) next »