RE: [PHP] XSLT; XML => PHP code
| From: | Darren Gamble | Date: | Thu, 28 Mar 2002 21:52:07 +0000 |
| Subject: | RE: [PHP] XSLT; XML => PHP code | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90597@lists.php.net to get a copy of this message | ||
Good day,
To have PHP evaluate string contents as an expression, use eval().
The usual disclaimer comes with this function... be careful.
============================
Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948
-----Original Message-----
From: Erik Price [mailto:pricee@hhbrown.com]
Sent: Thursday, March 28, 2002 2:47 PM
To: php-general@lists.php.net
Subject: [PHP] XSLT; XML => PHP code
I am using XSLT functions in PHP to transform a string (whose data is a
string of XML) into another string. Ideally, the second string will
consist of PHP code. I would like this outputted PHP code to be
executed within the same script as the that which performs this
transformation.
Here is what I am wondering -- will I be able to evaluate the variable
containing the new string somehow? In other words, I will have PHP code
trapped in a variable, which I will need to have evaluated in order to
have the code inside executed. How can I take a variable containing PHP
code and have it get executed along with the rest of the script?
In other words,
$php_code_in_here = 'echo "hi there";'; // PHP code in a variable
Will this variable just be evaluated by the script as it is parsed??
Forgive me if the answer is staring me in the face, I'm just not seeing
it.
Thanks,
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
pricee@hhbrown.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php