开发者

how to delete double values in array?

I've got an array like this one:

arrayname[1] = "jacob";
arrayname[2] = "peter";
arrayname[3] = "jacob";
arrayname[4] = "nicholas";

I want to remove the double jacob 开发者_Python百科so it will be like

arrayname[1] = "jacob";
arrayname[2] = "peter";
arrayname[3] = "nicholas";

How do I do that?


array_unique()


$array = array_unique($array);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜