Jump to content

Take comma seperated values from one array and put them in a new array


phpretard

Recommended Posts

I need to some how pull comma separated images $data[23] from this $data array and then put them into there own array so I can insert them into separate rows in a database.

 

 

    
This is the provided array:

$data[0] => VIN
$data[1] => StockNumber
    
...(all the other number here)
    
$data[23] => Image_URLs (comma seperated)
$data[24] => Equipment


// I need something like this (obviously doesn't work?!@#)

$delimiter = ",";
$img = explode($delimiter, $data[23]);

foreach($img as $pic){
$sqlPic = "insert into class_prodimages (pid image rank) values('".$LastId['id']."', '$pic', '".rand(1,20)."')"; 

}

 

 

Any help here?

 

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.