开发者

Possible to execute php string?

If I have a variable that contains PHP code... something like this:

$PageCode = "<?php\r\nrequire_once(\"../code/rushs_flickr_photos.php\");\r\开发者_如何学Cn?>";

Is it possible to execute that code within my page and assign it back to another variable? something like:

$PageContent = exec($PageCode);


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.


Yes look at eval() function

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜