Jump to content


Photo

Simple Array question...Maybe


  • Please log in to reply
2 replies to this topic

#1 bmopro

bmopro
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 25 October 2006 - 09:14 PM

Hello,
I have a loop set up to store data in an array...My question is this...
How would i take the data stored in an array and put it in one variable as follows...

$array[0] = 'data_0';
$array[1] = 'data_1';
$array[2] = 'data_2';
Turn this array into a varaible like this...

$data = 'data_0, data_1, data_2';

Thanks for the help!!
Bri

#2 roopurt18

roopurt18
  • Staff Alumni
  • Advanced Member
  • 3,749 posts
  • LocationCalifornia, southern

Posted 25 October 2006 - 09:16 PM

$data = implode(', ', $array);
PHP Forms : Part I | Part II

JavaScript: Singleton

http://www.rbredlau.com

#3 bmopro

bmopro
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 25 October 2006 - 09:29 PM

That's It!!!!
Thank You so Much!!!!
Bri




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users