Use PHP echo, if statements, and loops to output all three links.
array ( 'name' => 'Codecademy', 'url' =>'https://www.codecademy.com/', 'image' => '', 'description' => 'Learn to code interactively, for free.' ), 1 => array ( 'name' => '', 'url' => 'https://www.w3schools.com/', 'image' => 'w3schools.png', 'description' => 'W3Schools is optimized for learning, testing, and training.' ), 2 => array ( 'name' => 'Mozilla Developer Network', 'url' => 'https://www.codecademy.com/', 'image' => 'mozilla.png', 'description' => 'The Mozilla Developer Network (MDN) provides information about Open Web technologies.' ) ); // ************************************************** // Loop through the array and display the link information for ($i = 0; $i < count ($links); $i ++) { // Note that this block of code is almost identical to the php-if-switch examples // If there is not title, use the link URL as a title if ($links[$i]['name'] == "") { echo ''.$links[$i]['description'].'
'; } // If there is a link output the URL and make it clickable if ($links[$i]['url']) { // If there is a title use the title as the link if ($links[$i]['name']) { echo ''; } // If there is no name, use the URL else { echo ''; } } echo '';
print_r ($links);
echo '';
?>