摘要: 1.<?php$Scores=array(85,60,54,91,100,77);$MaxScores=91;$MinScores=80;foreach($Scoresas$Value)if($Value>$MaxScores)$MaxScores=$Value;foreach($Scoresas$Value)if($Value<$MinScores)$MinScores=$Value;echo"最高分为$MaxScores<br>";echo"最低分为$MinScores<br>";?>2.<?ph 阅读全文
posted @ 2012-09-15 16:34 scholarlzz 阅读(619) 评论(0) 推荐(0)
摘要: 1.Web的一大缺点是没有“通用组件模型”(commoncomponentmodel),影响了代码测试和重用。如果对于C或者Java等其他语言,它也许会帮你做优化,把strlen提取到前面去,只做一次就够了.而对于PHP来说,它在编译的时候不做任何优化,也就是说,你的strlen,会被调用很多次. 再比如:$table="table";while(++$i<1000){$sql="select*from".$table."whereid=".$i;} 没错,“select*from”.$table会被concat1000次..\ 阅读全文
posted @ 2012-09-15 16:32 scholarlzz 阅读(87) 评论(0) 推荐(0)
摘要: Web的一大缺点是没有“通用组件模型”(common component model),影响了代码测试和重用。 阅读全文
posted @ 2012-09-15 16:30 scholarlzz 阅读(137) 评论(0) 推荐(0)