Data from db in array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Data from db in array

Post 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
User avatar
GeertDD
Forum Contributor
Posts: 274
Joined: Sun Oct 22, 2006 1:47 am
Location: Belgium

Post by GeertDD »

Code: Select all

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

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