一些函數php

private function array_to_strings($array){
    $strings="";
	foreach ($array as $value) {
        $strings.=$value["promotion_id"].",";
    }
    $strings=trim($strings,",");
	return $strings;
}
private function find_diff_array($array1,$array2){
    $array=array();
    foreach ($array2 as $value2) {
        $array[$value2["promotion_id"]]=1;
    }
    $return_array=array();
	foreach ($array1 as $value1) {
        if(!array_key_exists($value1["promotion_id"],$array)){
            $return_array[]=$value1;
        }
    }
	return $return_array;
}
相關文章
相關標籤/搜索