如何使用jquery.each()显示数组数据

时间:2011-05-10 11:44:32

标签: jquery

我使用PHP使用mysql_fetch_array()生成了数组数据。

Array ( 
       [0] => Array 
       ( 
        [0] => 4 
        [msg_id] => 4 
        [1] => 1 
        [uid_fk] => 1 
        [2] => dddddddddddddd88234234 
        [message] => dddddddddddddd88234234 
       ) 
       [1] => Array 
       ( 
        [0] => 3 
        [msg_id] => 3 
        [1] => 1 
        [uid_fk] => 1 
        [2] => 2324234 
        [message] => 2324234 
       )
       [2] => Array 
       (
         [0] => 2 
         [msg_id] => 2 
         [1] => 1 
         [uid_fk] => 1 
         [2] => 123123 
         [message] => 123123 
         )
     )

1 个答案:

答案 0 :(得分:1)

您可以json_encode (PHP)您的数组,然后使用$.parseJSON() (jQuery)