<?php
function itemList(){
$items= array(
"skateboard" => array(
"name" => "Skateboard"
"type" => "drawings"
"namestripped" => "skateboard"
),
"looklocal" => array(
"name" => "Look Local"
"type" => "graphic-design"
"namestripped" => "looklocal"
),
);
reset($items);
while (list(, $value) = each($items)) {
echo '<li class="item '. $value["type"] .'">';
echo '<a class="fancybox" rel="group" href="images/portfolio/' . $value["type"] . '/'. $value["namestripped"] . '_l.jpg">';
echo '<img src="images/portfolio/' . $value["type"] . '/'. $value["namestripped"] . '.jpg" alt="' . $value . '"/>';
echo '<h3>' . $value["name"] . '</h3>'; echo '</a>';
echo '</li>';
}
}
?>
How badly have I messed up the syntax? When I try this code it doesn’t output anything, not even the HTML.
Your code only defines the function, but doesn’t execute it.
You would execute it like so:
EDIT You also had some typo’s in your PHP code. Here is the fixed version: