php - Form Table out of JSON Array -
i've got simple question.
i'm getting php array mysql query , encoded looks this:
[ { "id": "111111", "joindate": "2015-05-13", "nickname": "testuser1" }, { "id": "222222", "joindate": "2015-05-06", "nickname": "testuser2" }, { "id": "333333", "joindate": "2000-01-01", "nickname": "testuser3" } ]
how can iterate through array , form simple html table?
heres example of outputting array elements in table rows.
foreach ($elements $element) { echo '<tr><td>'. $element['id'].'</td><td>>'. $element['nickname'].'</td></tr>'; }
Comments
Post a Comment