Jump to content

[SOLVED] how to split array??


ohdang888

Recommended Posts

i have a var like this:

$_POST['ids'] = array('1', '12345', '25645');

 

and i want to split it and insert them in my databse...i had this code to do it:

if(isset($_POST['ids'])){

foreach($ids as $value){

 

echo $value."<br>";

//mysql insert

}

}

 

but i'm getting this error:

Warning: Invalid argument supplied for foreach() in /home/public_html/links/invite.php on line 10

 

whats wrong?

Thanks.

 

Link to comment
https://forums.phpfreaks.com/topic/134372-solved-how-to-split-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.