How to execute PHP code that's read in?
Posted: Wed Nov 24, 2004 9:14 am
Hi there,
We have a situation where we need to read a php file from another php file, and somehow get the php code within the file we've read to execute (basically, have variables replaced with their values) after we've read it.
Is there a way to do this?
If not, I'm sure we could probably do it via brute force... that is, search the string for all values like <?=$var1?> ... <?=$var2?> ... and replace them with the actual values. What would be the correct syntax for doing this?
Thanks!
We have a situation where we need to read a php file from another php file, and somehow get the php code within the file we've read to execute (basically, have variables replaced with their values) after we've read it.
Is there a way to do this?
If not, I'm sure we could probably do it via brute force... that is, search the string for all values like <?=$var1?> ... <?=$var2?> ... and replace them with the actual values. What would be the correct syntax for doing this?
Thanks!