我正在开发一个系统,我需要比较 2 个数组并回显正确的值
[1] => Array
(
[Message] => Array
(
[id] => 4f8c74ce-8590-4e8b-a5ba-6f54b2158146
[user_id] => 1
[to_user_id] => 3
[created] => 2012-04-16 21:36:46
[last_message_id] => 8
[message_count] => 2
)
[MessageItem] => Array
(
[0] => Array
(
[id] => 7
[message_id] => 4f8c74ce-8590-4e8b-a5ba-6f54b2158146
[user_id] => 1
[message] => Whola amigo
[read] => 0
[created] => 2012-04-16 21:36:46
)
[1] => Array
(
[id] => 8
[message_id] => 4f8c74ce-8590-4e8b-a5ba-6f54b2158146
[user_id] => 1
[message] => sdfsdfdsfdsfsdfds
[read] => 0
[created] => 2012-04-16 21:37:54
)
)
)
所以..我想
ECHO ['MessageItem]['message'] WHERE ['MessageItem]['id'] == ['Message]['last_message_id']
不知道如何使用 php 来实现这一点!?!
感谢您的任何帮助!
-汤姆