array_unique - php - codeigniter

时间:2016-09-06 07:46:51

标签: php codeigniter array-unique

$skillsarray = ["php","java","ios","php","php","php","php","java","java","ios"];

$cityarray = ["Chennai","Theni","Theni","Mumbai","Chennai","Theni","Chennai","Hyderabad","Theni","Madurai"];

如果我将array_unique用于$skillsarray,请将结果设为

  

[ “PHP”, “Java” 的, “IOS”]

如果我将array_unique用于$cityarray,请将结果设为

  

{ “0”: “奈”, “1”: “与Theni”, “3”: “孟买”, “7”: “海得拉巴”, “9”: “马杜赖”}

有人能解释为什么array_unique($cityarray)正在产生字典结果吗?