rework autocomplete: Access list of smilies over JSON

This commit is contained in:
rabuzarus
2016-02-01 17:43:12 +01:00
committed by Roland Haeder
parent 1a7ec34e71
commit 12479fb478
4 changed files with 215 additions and 156 deletions
+15
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();
}