开发者

Is it possible to include PHP code that is in memory?

开发者 https://www.devze.com 2023-03-14 15:19 出处:网络
Say I have a vari开发者_StackOverflow中文版able containing PHP code, can I include its content as if it was a normal PHP file ?

Say I have a vari开发者_StackOverflow中文版able containing PHP code, can I include its content as if it was a normal PHP file ?

For example, the PHP code could be a class declaration.


You don't have a variable containing php code. You have a string. You can execute a string as php with the evil eval function, but puppies AND kittens will die!


eval($your_variable);

Be aware about security holes!This is very dangerous and should NOT be based on user's input !


You could use eval to evaluate any code that you have in your string, however it is evil. What exactly are you trying to do?

0

精彩评论

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