Since your logos and urls exist in pairs, you can use a single loop over the logos and access the urls via the shared index. Code: ([Demo][1]) foreach ($jsonPartenaires['logo'] as $i => $logo) { printf( '<a href="%s"><img src="%s"></a><br>', $logo, $jsonPartenaires['url_partenaire'][$i] ); } Output: (tabbed and spaced for readability) <a href="images/website_logo_1.png"> <img src="https://www.url_website_1.fr"> </a> <br> <a href="images/website_logo_2.png"> <img src="https://www.url_website_2.fr"> </a> <br> <a href="images/website_logo_3.png"> <img src="https://www.url_website_3.fr"> </a> <br> Using `printf()` or `sprintf()` (the silent version), enables you to bind variables to a string without the noise of string concatenation or interpolation. If you ever want to call a string function on either variable (to prepare the strings, you can just wrap the 2nd or 3rd parameter in the desired function(s). --- Functional code styling might be too intimidating for developers who are just starting to learn php, but the benefit is being able to join the generated html strings with `<br>` -- avoiding the trailing `<br>`. Code: ([Demo][2]) ([or without any `...`][3]) echo implode( '<br>', array_map( function(...$v) { return sprintf( '<a href="%s"><img src="%s"></a>', ...$v ); }, ...array_values($jsonPartenaires) ) ); (The "spread/splat operator" is used to unpack multiple subarrays when passing data into the custom function, receiving the data in the custom function, and again unpacking the data into `sprintf()`.) [1]: https://3v4l.org/SQDY6 [2]: https://3v4l.org/fthvD [3]: https://3v4l.org/Ybqki