PHP LINKS LIST ARRAYS AND FUNCTIONS

Here is a list of links, and several different functions that you can use for printing them out.


ENTER URL ARRAY AND LINK NAME

<?php
$li_array[0] = "<a href=pictable.php>&lt&gt&nbsp</a>Art<br />";
$li_array[1] = "<a href=date.php>&lt&gt&nbsp</a>Date<br />";


YOU CAN REARRANGE THE LINKS IN ANY ORDER THAT YOU WANT THEM TO BE WHEN THEY ARE PRINTED OUT JUST BY CHANGING THE ORDER OF THE NUMBERS

CODES TO PRINT LIST AS YOU WANT BY NUMBER

echo $li_array[0];
echo $li_array[1];
?>
AND SO ON BY NUMBER IN ANY ORDER

<> Art
<> Date
<> Table
<> Table-X
<> Alink
<> Blink
<> Clink
<> Dlink
<> Elink
<> Flink
<> Glink
<> Hlink
<> Ilink


YOU CAN PRINT LIST WITH JUST A LOOP AS IS WITH THIS CODE. JUST CHANGE THE NUMBER IN THE CODE TO THE TOTAL NUMBER OF LINKS IN YOUR LIST

for($i=0; $i<=12; $i++)
{
print $li_array[$i] ;
}

<> Art
<> Date
<> Table
<> Table-X
<> Alink
<> Blink
<> Clink
<> Dlink
<> Elink
<> Flink
<> Glink
<> Hlink
<> Ilink


YOU CAN PRINT IN REVERSE ORDER WITH THIS FUNCTION SO THAT LAST LINK ADDED WILL BE LISTED ON TOP

for($i=12; $i>-1; $i--)
{
print $li_array[$i];
}

<> Ilink
<> Hlink
<> Glink
<> Flink
<> Elink
<> Dlink
<> Clink
<> Blink
<> Alink
<> Table-X
<> Table
<> Date
<> Art


YOU CAN PRINT LIST ALPHABETICALLY WITH THIS FUNCTION BUT IT GOES BY URL, STILL GOOD TO KNOW FOR OTHER TYPES OF LISTS

sort($li_array);
for($i=0; $i<=12; $i++)
{
print $li_array[$i];
}
<> Table-X
<> Date
<> Alink
<> Blink
<> Clink
<> Dlink
<> Elink
<> Flink
<> Glink
<> Hlink
<> Ilink
<> Art
<> Table


YOU CAN REVERSE THEM ALPHABETICALLY BUT IT LISTS ALPHABET BY URL

rsort($li_array);
for($i=0; $i<=12; $i++)
{
print $li_array[$i];
}
rsort($li_array);


<> Table-X
<> Date
<> Alink
<> Blink
<> Clink
<> Dlink
<> Elink
<> Flink
<> Glink
<> Hlink
<> Ilink
<> Art
<> Table