I need help with this PHP code as I try to implement it into my html body I get an array to string conversion error.
I came up with this, I want to print out the unordered list without concatenations.
<?php foreach($links as $title):?> <ul> <a href = "<?= $links ?>"><?= $title ?></a> </ul> <?php endforeach ?>
I made this code up from this hashes of arrays.
$links = [ ['title' => 'Slack', 'href' => 'https://slack.com'], ['title' => 'Google','href' => 'https://www.google.ca'], ['title' => 'Stack', 'href' => 'https://stackoverflow.com'] ];
Check the Answers