Jump to content

Foreach and add vars


rockinaway

Recommended Posts

I have a foreach loop:

 

foreach ($array as $key => $value)
{

}

 

Now what I want to do:

- Say the $value is 'test'. In the foreach, I want to add an ending to this $value, and create a variable with that name. So eventually I will have a variable called $test_ending, from that initial $value.

 

I have tried dong things like $value.$ending... doesn't work :S

Link to comment
https://forums.phpfreaks.com/topic/126474-foreach-and-add-vars/
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.