I’m fairly new to PHP, and have been asked to create an output from an array which displays a set of images which are linked to other pages. The array works well, looking up the page title, and finding connections in the SQL, before returning the thumbnails for the connected pages, which are linked to the page the thumbnail is from.
When I run an echo to show the results, I get a single column of all the thumbnails. I need to create a table style instead, with a grid 4 columns wide, and as many rows as required by the number of images in the output.
I’ve tried to explore loops to create this table, but seem to be getting stuck.
The code used to create the thumbnails is:
$country_logo = f_print(array( 'data' => 'p2p', 'type' => 'mainlogo', 'args' => array( 'connection_type' => 'client'.$_set['lang_postfix'].'_to_location'.$_set['lang_postfix'].'', 'post_type' => 'client', 'connection_id' => $post->ID, 'alternative' => "", ), )); echo $country_logo; }
the f_print function finds the thumbnails and their connected url link and combines them to create the linked thumbnails.
Does anyone have any guidance on creating a table layout of the output variable $country_logo?
I really appreciate any insight, I’m getting a little stuck with exactly how to format the output