Skip to content
Advertisement

How to implement various behaviour in PHP?

I have a site to which the administration uploads the code written with PHP which is saved in the database. The uploaded code must be launched on the site when opening a special page.

Maybe there are some ideas how this can be implemented without eval()?

Advertisement

Answer

eval() can be used in such way if there are no security issues. But also creating PHP class files and making object instances of it dynamically via new $classNameString was a solution for me.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement