开发者

Get distinct values from an array using php

开发者 https://www.devze.com 2023-02-16 11:51 出处:网络
Does anybody know how to get the distinct values from an array usi开发者_如何学Gong PHP: This is my MySQL query:

Does anybody know how to get the distinct values from an array usi开发者_如何学Gong PHP:

This is my MySQL query:

SELECT DISTINCT url_id, time_spent FROM library ORDER BY url_id


Not really sure which you want to do, the "distinct" should do it along with a group by in SQL.

But, if you want to somehow go through the data afterwards use array_unique.

Your question is unclear


Take a look at array_unique().

0

精彩评论

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