+ 1
What's the problem in this?
<?php $today = ('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); foreach($today as $tday){ switch ($tday) { case "Mon": echo "Today is Monday."; break; case "Tue": echo "Today is Tuesday."; break; case "Wed": echo "Today is Wednesday."; break; case "Thu": echo "Today is Thursday."; break; case "Fri": echo "Today is Friday."; break; case "Sat": echo "Today is Saturday."; break; case "Sun": echo "Today is Sunday."; break; default: echo "Invalid day."; } } ?>
8 Antworten
+ 4
you left out the key word array in your array declaration.$today=array(,,,_)
+ 4
demasiado excelente
+ 3
for each need an array
+ 2
you should write $today=array ('Mon','Tue','Wed','Thu','Fri','Sat','Sun,);
Then you will get the output
0
$today = array('Mon'... and so on.
u forgot "array"
0
Space between items in array(stay)..
0
$today=array
0
email me if you don't mind (aes249801@gmail.com)