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?

 

Link to comment
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.