src/Bandolier/Type/Encoded.php
public static function isJson($string)
    {
        if (!is_string($string) || (is_string($string)
                && substr($string, 0, 1) !== '{'
                && substr($string, 0, 1) !== '[')
        ) {
            return false;
        }
        @json_decode($string);
        return (json_last_error() == JSON_ERROR_NONE);
    }
public static function isJson($string)
    {
        if (!is_string($string) || (is_string($string)
                && substr($string, 0, 1) !== '{'
                && substr($string, 0, 1) !== '[')
        ) {
            return false;
        }
        @json_decode($string);
        return (json_last_error() == JSON_ERROR_NONE);
    }
public static function isJson ( $ string ) { if ( ! is_string ( $ string ) || ( is_string ( $ string ) && substr ( $ string , 0 , 1 ) !== '{' && substr ( $ string , 0 , 1 ) !== '[' ) ) { return false ; } @ json_decode ( $ string ) ; return ( json_last_error ( ) == JSON_ERROR_NONE ) ; }
Check if string is json
@param $string
@return bool
Check if string is json