Jump to content

Pulling database value in to array


adrian28uk

Recommended Posts

How do I pull information from one of the fields in my database and put this into an array.

The information in the field is stored as follows with a comma between each number

 

1342,1873

 

I need to get these numbers in to the array, then after this I can pass each value and check this against another table in my database.

I tried $arr=array($row['numbers']); and of course it did not work.

 

I need it so when pulled from the database it formats like below

 

$arr=array("1342","1873");

 

foreach ($arr as $value)

{

// rest of code //

}

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/51493-pulling-database-value-in-to-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.