...

View Full Version : array to string help



moos3
11-08-2007, 05:45 AM
I have a array like so


// results from db
$v[0] = 'blue';
$v[1] = 'red';
$v[2] = 'green';
// the size of the array can change based on the number of the colors for each product

// I need to output it in a input text box like the following
$value = 'blue,red,green';

// I figure some type of loop but I' don't know which one

shyam
11-08-2007, 05:55 AM
$value = implode(',', $v);

moos3
11-08-2007, 06:10 AM
thanks I didn't realize the implode made it s string.

aedrin
11-08-2007, 05:08 PM
What else would it have been turned into? ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum