Jump to content

String to PHP Function


eleljrk

Recommended Posts

The question is simple, but the answer seems impossible.

I've been trying everything, but now I have to ask the experts.. :P

 

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.