<?php
$jsonPartenaires = json_decode('{
"logo":
["images/website_logo_1.png","images/website_logo_2.png","images/website_logo_3.png"],
"url_partenaire":
["","https://www.url_website_2.fr",""]
}', true);
echo implode(
"<br>",
array_map(
function($logo, $url) {
$html = sprintf('<img src="%s">', $logo);
if ($url) {
$html = sprintf('<a href="%s">%s</a>', $url, $html);
}
return $html;
},
$jsonPartenaires['logo'],
$jsonPartenaires['url_partenaire']
)
);
preferences:
31.3 ms | 402 KiB | 5 Q