在下面的PHP函数中,我想排除cat_ID=1
如何从数组中排除项目?
我该怎么办?
function get_cats(){
$post_cats= array();
$categories = get_the_category();
foreach($categories as $cat){
array_push($post_cats, $cat->cat_ID);
}
return $post_cats;
}
get_the_category()返回当前柱被分配给