-2
在這裏,我想只顯示數學馬克顯示只有數學的價值,我不知道該怎麼辦,我想,但我不能夠顯示: -如何在這段代碼
<?php
$marks1=array(
\t array("Maths"=>80,"Physics"=>89,"Chemistry"=>79),
\t array("Maths"=>90,"Physics"=>78,"Chemistry"=>87),
\t array("Maths"=>78,"Physics"=>90,"Chemistry"=>79)
);
echo "<ul>";
for($r=0;$r<count($marks1);$r++)
{
\t echo "<li>";
\t foreach($marks1[$r] as $key=>$value)
\t {
\t \t echo $key." = ".$value." ";
\t }
\t echo "</li>";
\t echo "<br><br>";
}
echo "</ul>";
?>
'$ marks1 [$ r] ['Maths']'。努力,閱讀PHP手冊。 –
'if(key =='Maths'){echo $ key。「=」。$ value。「」;}' –
哦,現在已經知道了,如果(key =='Maths')你錯過了$ –