public function isJson() {
        if (!$this->endsWith('}') && !$this->endsWith(']')) {
            return false;
        }

        return !is_null(json_decode($this->str));
    }
public function isJson() {
        if (!$this->endsWith('}') && !$this->endsWith(']')) {
            return false;
        }

        return !is_null(json_decode($this->str));
    }
public function isJson ( ) { if ( ! $ this -> endsWith ( '}' ) && ! $ this -> endsWith ( ']' ) ) { return false ; } return ! is_null ( json_decode ( $ this -> str ) ) ; }
Returns true if the string is JSON, false otherwise.

@return bool Whether or not $str is JSON
Returns true if the string is JSON false otherwise .