Reputation: 11454
If I have a variable that contains PHP code... something like this:
$PageCode = "<?php\r\nrequire_once(\"../code/rushs_flickr_photos.php\");\r\n?>";
Is it possible to execute that code within my page and assign it back to another variable? something like:
$PageContent = exec($PageCode);
Upvotes: 0
Views: 634
Reputation: 85458
Yes. You are looking for eval()
.
This is however considered very bad practice. Whatever it is that you are trying to do, there is most likely a better way.
Upvotes: 9