i am trying to display a list of image from some link within a array of hashes. beside some other image from my own folder. Thanks in advance
$config = [
'gallery_name' => 'my_heading',
'unsplash_categories' => ['array','of','category','keywords'],
'local_images' =>
['folder/jpg1.jpg','folder/jpg2.jpg','folder/jpg1.jpg','folder/jpg4.jpg']
];
in HTML, what tried.
<?php foreach($config as $my_config => $gallery_name): ?>
<h1><?php echo $gallery_name; ?></h1>
<?php endforeach ?>
<p>
<?php foreach($config as $img)
{
foreach($img['local_images'] as $local_img)
{
echo "<img src='".$local_img['']."' alt=''>.<br>";
}
foreach($img['unsplash_categories'] as $unsplash_img)
{
echo "<img src='".$unsplash_img['']."' alt=''>.<br>";
}
}
?>
</p>