Jump to content

Create a variable from an array, separated by commas


HuggieBear

Recommended Posts

I have the following array:

[code=php:0]$numbers = array(1, 2, 3, 4, 5);
[/code]

Now how do I get this into a variable that looks like this:

[code=php:0]$number_variable = "1, 2, 3, 4, 5";
[/code]

I realise this is the opposite of something like explode() but wondered the easiest way to get it from an array to a variable.

Regards
Huggie

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.