Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.