Get values from DB field into an array with PHP

Posted by Adnan on Stack Overflow See other posts from Stack Overflow or by Adnan
Published on 2010-05-29T17:50:25Z Indexed on 2010/05/29 17:52 UTC
Read the original article Hit count: 210

Filed under:
|

Hello,

I have a field in my DB that holds value separated by commas like;

$tmp_list = "COB,ISJ,NSJ,"

Now when I fetch that the row, I would like to have them in an array. I have used array($tmp_list) but I get the values in one line only like:

[0] => 'COB,ISJ,NSJ,'

instead of

[0] => 'COB',
[1] => 'ISJ',
[2] => 'NSJ'

All help is appriciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays