I am using the Slim framework with PHP to create a RESTful API for my app. However, I assumed that the framework would have some way of creating easier JSON outputs rather than
function _die($array){ echo json_encode($array); exit; } $result = mysql_query("SELECT * FROM table"); while($row = mysql_fetch_assoc($result)){ $array[] = $row; } _die($array);