Write a script to print to the browser a different url every day of the month with a different category of url for each day of the week using a multi-dimensional array and no conditional statement.
Heres my code.. Thank you for your help..
Code: Select all
<?
// Set date varibles
$month=(date("j")-1);
$week=date("W");
$today=date("n/j/y");
$end=("$main[$week][$month]");
//Set arrays
$main=array($games,$web_hosts,$search_engines,$isp);
$games=array("www.blizzard.com",
"www.thesims.com",
"www.simcity.com",
"www.diablo.com",
"www.blackandwhite.com",
"www.quake.com",
"www.maxpayne.com");
$web_hosts=array("www.alien-web-networks.com",
"www.kytec.com",
"www.hostforweb.com",
"www.planethosting.com",
"www.powweb.com",
"www.dellhost.com",
"www.alienwebhost.com");
$search_engines=array("www.yahoo.com",
"www.google.com",
"www.ask.com",
"www.msn.com",
"www.hotbot.com",
"www.updated.com",
"www.altavista.com");
$isp=array("www.aol.com",
"www.cdsnet.net",
"www.internetcds.com",
"www.cvc.com",
"www.charter.com",
"www.fireserve.net",
"www.msn.com",
"www.juno.com");
//print to screen
echo("Today is $today");
echo(" So that means that todays link is $end");
?>