0
我正在嘗試對那些未讀取的值爲0的消息進行計數。我收到錯誤消息,它試圖獲取非對象的屬性,我理解爲什麼但不知道如何做個人下午消息的計數。計算個人消息
<?php echo count($personal_messages->message_read == 0); ?>
Array
(
[0] => stdClass Object
(
[id] => 2
[subject] => Test 2
[date_sent] => 2012-03-05 00:00:00
[first_name] => Jeffrey
[last_name] => Davidson
[message_read] => 1
)
[1] => stdClass Object
(
[id] => 1
[subject] => Testing
[date_sent] => 2012-03-04 00:00:00
[first_name] => Jeffrey
[last_name] => Davidson
[message_read] => 0
)
)
然後我「D只是回聲$計數的foreach之外 – 2012-03-05 17:40:05