leenooks/src/helpers.php
2018-06-12 16:09:27 +10:00

15 lines
227 B
PHP

<?php
// is_json helper
if (! function_exists('is_json')) {
function is_json($string) {
try {
json_decode($string);
} catch (\Exception $e) {
return FALSE;
}
return (json_last_error() == JSON_ERROR_NONE);
}
}