我真的被困在這裏。我有一個如下所示的數組。 現在我想對所有數組計數postStatus,其中postStatus = 0。數值爲0的數組中計數
所以在這種情況下,會有2個。但我該怎麼做?
Array
(
[1] => Array
(
[postId] => 1
[postHeader] => Post-besked #1
[postContent] => Post content #1
[postDate] => 2011-12-27 17:33:11
[postStatus] => 0
)
[2] => Array
(
[postId] => 2
[postHeader] => Post-besked #2
[postContent] => POst content #2
[postDate] => 2011-12-27 17:33:36
[postStatus] => 0
)
)
op只想計算'postStatus'爲'0'的項目,這將計數,無論值。 – 2011-12-30 19:23:51
@Madmartigan你在哪裏看到的?我看到「我想統計postStatus」,沒有說他們是0的任何內容,你認爲是因爲他打印的數據... – 2011-12-30 19:28:01
閱讀問題標題,OP給我們留下了一個誤導性的例子。 – 2011-12-30 19:28:37