I have an array containing strings of URLs, however some of the array elements are also an array. So some might be http://google.com, others might be:
Array([0] => http://yahoo.com [1] => http://msn.com)
I am trying to add a list of all these urls to a database. However, I need the list to expand for the multi-dimensional array. i.e. the list I am trying to establish should look like:
http://google.com
http://yahoo.com
http://msn.com
So I was initially doing this through a foreach, and then I thought I could expand the multi-dimensional arrays with a foreach within a foreach, but not sure that works. This is what I have currently, but doesnt work.
foreach($allfiles as $file) {
if(is_array($file)) {
$files = $file {
foreach($files as $file)
}
}
$qry2 = mysqli_query($con,"INSERT INTO files(name) VALUES($file)");
echo '<br>'.$file;
if($qry2) echo ' -success';
else echo ' -error';
}