audittr180
-
Posts
5 -
Joined
-
Last visited
Never
Posts posted by audittr180
-
-
i have the following array
$fruits = array("cherry" => "red", "apple" => "red", "kiwi" => "green", "strawberry" => "red", "pear" => "yellow", "melon" => "green",
"grapes" => "green", "watermelon" => "red", "banana" => "yellow")
using the array_count_values($fruits) i get
Array ( => 4 => 3 [yellow] => 2 )
how can i asign the value of each key to a variable?
-
i have the following array
$fruits = array("cherry" => "red", "apple" => "red", "kiwi" => "green", "strawberry" => "red", "pear" => "yellow", "melon" => "green",
"grapes" => "green", "watermelon" => "red", "banana" => "yellow")
using the array_count_values($fruits) i get
Array ( => 4 => 3 [yellow] => 2 )
how can i asign the value of each key to a variable?
-
thnx a lot!!!!!!
-
I want to print in an html table the Seasons,the Months,and the days of each month.
the following code prints the seasons and the days
i need another foreach in between that prints the months also
Any ideas???
Please help...
$seasons=array (
"Fall"=> array ("September"=>"30","October"=>"31","November"=>"30"),
"Winter"=> array ("December"=>"31","January"=>"31","February"=>"28"),
"Spring"=> array ("March"=>"31","April"=>"30","May"=>"31"),
"Summer"=> array ("June"=>"30","July"=>"31","August"=>"31")
);
$tab = "<table border=\"1\">";
foreach($seasons as $season => $months) {
$tab .= "<tr><td colspan=\"4\">$season</td></tr>" ;
$tab .= "<tr>" ;
foreach($seasons[$season] as $days) {
$tab .= "<td>$days</td>" ;
}
$tab .= "</tr>" ;
}
$tab .= "</table>" ;
echo $tab ;
asign a variable to an array value
in PHP Coding Help
Posted
thnx!!!!!