$data[] = array( "name" => "云代码http://yuncode.net", "rank" => "40" ); $data[] = array( "name" => "博客园", "rank" => "50" ); $data[] = array( "name" => "CSDN", "rank" => "60" ); $data[] = array( "name" => "ITEYE", "rank" => "50" ); shuffle($data); $i = 0; foreach($data as $key =>$value ){ if($i < 2) { echo $data[$key]['name'].'<br />'; } $i++; }
by: 发表于:2017-10-19 09:41:40 顶(0) | 踩(0) 回复
??
回复评论