Code problems..
Posted: Thu Jul 10, 2003 7:42 am
I'm using a online tutorial to learn php and at each end of the chapter it tells you to do soemthing before you go on.. I'm having problems getting this one to work.. Heres the objective..
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..
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");
?>