I have a page that will need to generate thumbnail images for each article. The number of thumbnails will vary for each so I want to check the article in the database and create an array for all of the thumbnails but i’m struggling with the logic.
This is what I have so far:
for ($i=1; $i<20; $i++) {
$thumbImages = array(
'src' => $newblogDoc['tvs']['thumbnail-image-' . [$i]]
);
}
Is this the right direction? Is there a more efficient way to put this into an array?
Your question isn’t very clear but if you want to make an associative array of arrays then you need to do: