Page 1 of 1

Data from db in array

Posted: Tue Nov 28, 2006 7:12 am
by wizzard81
Hello,

Does someone knows how i can put data from a db field called pictures with the value like this 1,2,3,4,5,6,7,8 in an array.

So i would like to grab the data out of my table and put everything in an a array like $array[]=1, $array[]=2,$array[]=3
each number before or after the , as an array item.

Cheers,
Kris

Posted: Tue Nov 28, 2006 7:29 am
by GeertDD

Code: Select all

$string = '1,2,3,4,5,6,7,8';

$array = explode(',', $string);