<br><?php <br>header("Content-type: text/html; charset=utf-8");<br> 函數測試($arr){<br><span></span>$maxvalue = $arr[0];<br> <span></span><br>$maxvalue = $arr[0];<span> </span><br><span>$maxvalue = $arr[0];</span> <br><span></span> $index = 0;<br><span></span>for($i = 1;$i<count><span></span>if($maxvalue<span></span>$最大值= $arr[$i];<br><span></span>$index = $i;<br><span></span>}<br><br><br><span></span><br>}<span></span><br>回$maxvalue <br><br><br>$max = test($arr);<br><span></span>echo $max;<br>?><span></span> <br> arr[0];<span></span><br>var index = 0;<span></span><br>for(var i=1;i<arr.length><br>if(max<arr><br>max = arr[i];<span></span><br>index=i;<span></span><br>}<span></span><br>}<span></span><br>回傳最大值;<span></span><br>conslog(I<span>返回最大值;</span><br> ,5];<span></span><br>document.write(test(array));<br> <br> <div></div></arr></arr.length></count>