implement usr_msg_id

This commit is contained in:
2018-11-12 13:03:01 +01:00
parent 2163ae4dbf
commit cae6ff6271
4 changed files with 117 additions and 39 deletions

View File

@@ -196,4 +196,22 @@ function api_return($http_code, $message)
http_response_code($http_code);
echo $message;
die();
}
/**
* @param String $str
* @param String[] $path
*/
function try_json($str, $path)
{
try
{
$o = json_decode($str);
foreach ($path as $p) $o = $o[$p];
return $o;
}
catch (Exception $e)
{
return null;
}
}