rework autocomplete: Access list of smilies over JSON

This commit is contained in:
rabuzarus 2016-02-01 17:43:12 +01:00
parent 162f754e2d
commit 5f7c5e6ab6
4 changed files with 215 additions and 156 deletions

View file

@ -1344,3 +1344,18 @@ function short_link($url) {
}
return $slinky->short();
}};
/**
* @brief Encodes content to json
*
* This function encodes an array to json format
* and adds an application/json HTTP header to the output.
* After finishing the process is getting killed.
*
* @param array $x
*/
function json_return_and_die($x) {
header("content-type: application/json");
echo json_encode($x);
killme();
}