标签:
<?php $data = array(123,"ab","abc",123); function compare($data){ $flag = true; for($i=0;$i<count($data) -1 ;$i++){ for ($j = $i + 1; $j < count($data);$j++ ) { if($data[$i] == $data[$j]) { $flag = false; break; } } } return $flag; } var_dump(compare($data));
标签:
原文地址:http://my.oschina.net/yonghan/blog/489016