M
meganixz25
Guest
I am still a php beginner...
i have a problem with my code ;.. here:
$var1= round((100*$pool_responses[1])/$total_responses,1);
$var2= round((100*$pool_responses[2])/$total_responses,1);
$var3= round((100*$pool_responses[3])/$total_responses,1);
$var4= round((100*$pool_responses[4])/$total_responses,1);
$var5= round((100*$pool_responses[5])/$total_responses,1);
$var6= round((100*$pool_responses[6])/$total_responses,1);
$var7= round((100*$pool_responses[7])/$total_responses,1);
$var8= round((100*$pool_responses[8])/$total_responses,1);
$var9= round((100*$pool_responses[9])/$total_responses,1);
// print the form, which includes de answers and the percentajes
$shop = array(
"1" => $var1,
"2" => $var2,
"3" => $var3,
"4" => $var4,
"5" => $var5,
"6" => $var6,
"7" => $var7,
"8" => $var8,
"9" => $var9,
);
arsort($shop);
echo "<table border='1'>";
foreach ($shop as $key => $value)
{
echo "<tr>";
echo "<td>";
echo "Rank";
echo "<br><img src=".$key.".jpg>\n";
echo "</td>";
echo "</tr>";
}
echo "</table>";
?>
The output for that is...
Rank
Pic1
Rank
Pic2
Rank
Pic3
Rank
Pic4
Rank
Pic5
Rank
Pic6
Rank
Pic7
Rank
Pic8
Rank
Pic9
assuming that Pic[x] is a image... so i want the output to be
OutPut:
Rank1
Pic9
Rank2
Pic1
Rank3
Pic4
Rank4
Pic4
Rank5
Pic2
Rank6
Pic3
Rank7
Pic8
Rank8
Pic6
Rank9
Pic6
please help!
i have a problem with my code ;.. here:
$var1= round((100*$pool_responses[1])/$total_responses,1);
$var2= round((100*$pool_responses[2])/$total_responses,1);
$var3= round((100*$pool_responses[3])/$total_responses,1);
$var4= round((100*$pool_responses[4])/$total_responses,1);
$var5= round((100*$pool_responses[5])/$total_responses,1);
$var6= round((100*$pool_responses[6])/$total_responses,1);
$var7= round((100*$pool_responses[7])/$total_responses,1);
$var8= round((100*$pool_responses[8])/$total_responses,1);
$var9= round((100*$pool_responses[9])/$total_responses,1);
// print the form, which includes de answers and the percentajes
$shop = array(
"1" => $var1,
"2" => $var2,
"3" => $var3,
"4" => $var4,
"5" => $var5,
"6" => $var6,
"7" => $var7,
"8" => $var8,
"9" => $var9,
);
arsort($shop);
echo "<table border='1'>";
foreach ($shop as $key => $value)
{
echo "<tr>";
echo "<td>";
echo "Rank";
echo "<br><img src=".$key.".jpg>\n";
echo "</td>";
echo "</tr>";
}
echo "</table>";
?>
The output for that is...
Rank
Pic1
Rank
Pic2
Rank
Pic3
Rank
Pic4
Rank
Pic5
Rank
Pic6
Rank
Pic7
Rank
Pic8
Rank
Pic9
assuming that Pic[x] is a image... so i want the output to be
OutPut:
Rank1
Pic9
Rank2
Pic1
Rank3
Pic4
Rank4
Pic4
Rank5
Pic2
Rank6
Pic3
Rank7
Pic8
Rank8
Pic6
Rank9
Pic6
please help!