【问题标题】:How to implement a php Function which accepts a single array of integers and returns the unique integers separated by commas?如何实现一个接受单个整数数组并返回用逗号分隔的唯一整数的php函数?
【发布时间】:2010-02-22 07:17:27
【问题描述】:

如何实现一个接受单个整数数组并返回以逗号分隔的唯一整数的php函数?

例如:GetUniqueOnes($arr)

$arrr = 数组(34,54,68,141,151,54,151,54)

应该返回 34,54,68,141,151,161

【问题讨论】:

  • 学习如何格式化您的问题是一件好事。

标签: php unique


【解决方案1】:
$string = join(',', array_unique($array));

不需要函数;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多