I am creating a webpage for my newsletter archives.  The archives are divided by year (currently there is only 1, but there could be many), then by topic, before listing each newsletter.  There will always be exactly five topics, but the number of newsletters in each topic will vary. I add the name of the newest newsletter in only one place - at the end of the array. I have a link to the most recent newsletter above the rest of the archives.This code works fine, but the way that I am retrieving the most recent newsletter seems somewhat hackyThe newsletters are currently stored in my server as # segment year. $newsletter = array(        Year 1 => array(                First Topic => array(                            a,b,c,d,e,f,g,h,i,                            ),                Second Topic => array(                            j,k,l,m,n,o,ab,                            ),                Third Topic => array(                            cd,ef,fo,er,abd,cdf,eee,                            ),                Fourth Topic => array(                            fff,wet,csg,qqq,                            ),                Fifth Topic => array(                            ),                )        );$archive_design = ;foreach($newsletter as $gilYear => $book){    $i=1;    $archive_design .= <div id=$gilYear class=year>        <!--<h3> Year $gilYear </h3>-->        <div class=year-content>;    foreach($book as $book => $segment){        $archive_design .= <div id=$gilYear-$book class=column>            <b><u>$book</u></b>            <p></p>            <ul>            ;        foreach($segment as $segment){            $link = $i .strtolower($segment). .$gilYear;            $recent = $segment;            $i++;            $archive_design .= <li>                                <a href=\http://example.org/newsletter/$link.pdf\ target='_blank'>$segment </a>                                <hr/>                                </li>;        }        $archive_design .= </ul></div><!--end $gilYear-$book-->;    }    $archive_design .=  </div><!--end year-content -->            </div><!--end $gilYear -->;}?><html lang=en ><body><div id=header>        <a href=http://example.org/newsletter/<?php echo $link; ?>.pdf target=_blank> Current Issue - <?php echo $recent;?></a></br>    <h3>Click on the segment to view, download and enjoy the archives!</h3></div><div id=archives><?php echo $archive_design;?></div><!--end archives-->
Create archive webpage for newsletters based on nested array
php;html;array