0
創建陣列我有這樣PHP - 從數組
array (size=1)
45 =>
object(stdClass)[37]
public 'term_id' => string '45' (length=2)
public 'name' => string 'Appointments' (length=12)
public 'slug' => string 'appointments' (length=12)
public 'term_group' => string '0' (length=1)
public 'term_taxonomy_id' => string '48' (length=2)
public 'taxonomy' => string 'tribe_events_cat' (length=16)
public 'description' => string '' (length=0)
public 'parent' => string '0' (length=1)
public 'count' => string '1' (length=1)
public 'object_id' => string '625' (length=3)
46 =>
object(stdClass)[37]
public 'term_id' => string '46' (length=2)
public 'name' => string 'Appointmentx' (length=12)
public 'slug' => string 'appointmentx' (length=12)
public 'term_group' => string '0' (length=1)
public 'term_taxonomy_id' => string '48' (length=2)
public 'taxonomy' => string 'tribe_events_cat' (length=16)
public 'description' => string '' (length=0)
public 'parent' => string '0' (length=1)
public 'count' => string '1' (length=1)
public 'object_id' => string '626' (length=3)
一個數組,我想剝奪這個數組只有term_id
和merge
像這樣
array(45,46,...);
有人能幫助我嗎?
感謝您的輸入。其實你的代碼包含錯誤。 ''ids = array();'然後你在'object-> termId中錯過'$';' – Giri
@Giri Meh,我很快輸入了它,最近我還沒有在做PHP。 – thatidiotguy
嗯..謝謝。我已經upvoted你的答案:) – Giri