Jump to content

Storing php code as a variable


christo16

Recommended Posts

Hello,

I would like to store php code into a variable, heres an example:

 

function test ($var) {

$var; //I also tried echo $var;

return;

}

 

$string = "echo \"test\" ";

test ($string);

 

When it works, it will only output "echo test", instead of just "test".

Thank you for any help!

 

Link to comment
https://forums.phpfreaks.com/topic/52140-storing-php-code-as-a-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.