Zend - The PHP Company




HTML

Add Code


Links Displayer  

Type: code fragment
Added by: jasendorf
Entered: 10/07/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 6098
I use this to spit out external links for our ever popular "Links" page. Just add an array item and you've got alphabetized links.


<?PHP
/*******
external links list
*******/
//array for out of site links
//CASE SENSATIVE - upper case proceeds lower case 
$arr_outer_links = array(
        
'Licking County Sheriff' => array(
        
'url' => 'http://www.lickingcountysheriff.com' ,
        
'desc' => 'A valuable law enforcement information site which includes information ranging from Victim Advocate information to a listing of Sexual Offenders in Licking County.'
        
),
        
'Licking County Child Support Enforcement Agency' => array( 
        
'url' => 'http://www.state.oh.us/odhs/county/licking/' ,
        
'desc' => 'Information about the agency's serviceshistorylocation and most wanted failed support providers.'
        ),
        '
Licking Park District' => array(
        '
url' => 'http://www.msmisp.com/lpd/' ,
        
'desc' => 'Trail maps, park locations, special events and much more!'
        
),
        
);

//sort the list
ksort ($arr_outer_links);

echo 
"<ul>n";

//spit out list
//you can change the target if you like

while ( list($key$val) = each($arr_outer_links) ) {
    echo 
"<li><A href="$val[url]" target="new.window">$key</A> - $val[desc]nn";
}

echo 
"</ul>n";
?>


Usage Example


See the example


Rate This Script





Search



This Category All Categories