Remove duplicates from Array

前端 未结 2 1047
粉色の甜心
粉色の甜心 2021-01-22 09:58

Hi I have an array created from an XML file using this function.

# LOCATIONS XML HANDLER
#creates array holding values of field selected from XML string $xml
# @         


        
2条回答
  •  走了就别回头了
    2021-01-22 10:45

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

    $input = array(4, "4", "3", 4, 3, "3");
    $result = array_unique($input);
    var_dump($result);
    

提交回复
热议问题