Added helpers.php
This commit is contained in:
parent
c5413d5b50
commit
55d369df47
@ -18,7 +18,10 @@
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Leenooks\\": "src"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
|
15
src/helpers.php
Normal file
15
src/helpers.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user