eleljrk Posted July 9, 2010 Share Posted July 9, 2010 The question is simple, but the answer seems impossible. I've been trying everything, but now I have to ask the experts.. Here is the problem: global $_HEY; $things = array($_HEY, "again, hey", ".. ..", "more..", "etc"); foreach($things as $thing) { $count++; $variable = $count.": ".$thing."<br />"; } unset($count); unset($thing); $variable = strtoupper($variable); return $variable; Now, that is simple enough. Then everything is upside down when you read this: - All the basic PHP above is inside a string. Then I ask you for the answer: - How can I get this PHP out from the string and run it as a function..? That's the golden one! Link to comment https://forums.phpfreaks.com/topic/207308-string-to-php-function/ Share on other sites More sharing options...
eleljrk Posted July 10, 2010 Author Share Posted July 10, 2010 I have to commit that I just found a function called "create_function". Would this do what I need, can someone confirm? Link to comment https://forums.phpfreaks.com/topic/207308-string-to-php-function/#findComment-1083864 Share on other sites More sharing options...
joel24 Posted July 10, 2010 Share Posted July 10, 2010 http://php.net/manual/en/function.exec.php Link to comment https://forums.phpfreaks.com/topic/207308-string-to-php-function/#findComment-1083869 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.