How to find unique values in array

后端 未结 4 1561
小鲜肉
小鲜肉 2021-01-24 06:41

Here i want to find unique values,so i am writing code like this but i can\'t get answer,for me don\'t want to array format.i want only string

<         


        
4条回答
  •  灰色年华
    2021-01-24 07:21

    You can use array_unique() in single line like below:-

    ";print_r($unique_array); // print unique values array
    ?>
    

    Output:- https://eval.in/601260

    Reference:- http://php.net/manual/en/function.array-unique.php

    If you want in string format:-

    echo implode(',',$final_array);
    

    Output:-https://eval.in/601261

    The way you want is here:-

    https://eval.in/601263

    OR

    https://eval.in/601279

提交回复
热议问题