从数据库中读取php代码

Lets say I want to save function in database. For example we have table function with attributes: function and function name. For saving function for time we would save it in data base:

time_funtion(){ return time() } and "Time".

I have no idea how to execute this function after reading from DB is this even possible?

I could do this with files - read from database then write it in file, then include file and calling this function will work. Any other ideas?

Use eval("your PHP code here")

I'm not sure why you'd want to do this but you could use eval()

You can use eval() for this. But be careful what you save into your db. There are just a few problems where this is a useful approach. In 99% you don't need this and it's lacking security, because you are executing unkown code, which is not what you want.