PHP排除重复数组,排除重复英文字符串

/**
* 排除重复数组.
*
*
* $string="33,33,22,22,11,99,00,88,44,55,44,33";
* $array=explode(",", $string);
* $array2 = UniqueByChild($array,'');
* echo(implode(',',$array2));
*
*
*/
if ( ! function_exists('UniqueByChild'))
{
    function UniqueByChild($array, $child)
    {
        $child = "['" . implode("']['", explode(',', $child)) . "']";
        $buffer = array();
        foreach($array as $index => $value)
        {
            if(!empty($value))
            {
                eval("/$check = /$value{$child};");
                if(in_array($check, $buffer))
                {
                    unset($array[$index]);
                }
                else
                {
                    $buffer[] = $check;
                }
            }else
            {
                unset($array[$index]);
            }
        }
        return $array;
    }
}

你可能感兴趣的:(PHP,function,String,buffer)