whether the string is an serialized object or not

@param string $string
@return bool
2037
public static function isSerialized(string $string): bool {
        $data = @unserialize($string);
        if (false === $data) {
            return false;
        } else {
            return true;
        }
    }
905095
public static function isMessage(string $string): bool
    {
        return substr($string, 0, 2) == self::I18N_PREFIX
            && substr($string, -2) == self::I18N_POSTFIX;
    }
435309
private static function unserializeValue( &$string ) {
		$error = null;
		set_error_handler( function ( $errno, $errstr ) use ( &$error ) {
			$error = $errstr;
			return true;
		} );
		$ret = unserialize( $string );
		restore_error_handler();

		if ( $error !== null ) {
			self::$logger->error( 'Value unserialization failed: ' . $error );
			return [ false, null ];
		}

		$serialized = serialize( $ret );
		$l = strlen( $serialized );
		if ( substr( $string, 0, $l ) !== $serialized ) {
			self::$logger->error(
				'Value unserialization failed: read value does not match original string'
			);
			return [ false, null ];
		}

		$string = substr( $string, $l );
		return [ true, $ret ];
	}
913497
public static function jsonDecode($string)
    {
        if ($string) {
            $json = json_decode($string, true);
            // if json_decode failed
            if ($json === null) {
                self::jsonLastError();
            }
            return $json;
        } else {
            return false;
        }
    }
778883
protected static function unserialize($string)
    {
        if (is_array($string)) {
            return $string;
        }

        if (($data = unserialize($string)) !== false) {
            return $data;
        }

        return unserialize(stripslashes($string));
    }
687108
public static function isStreetNumber($string) {
        static $pattern = '/^[0-9A-Za-z-\/]+$/';
        return is_string($string) && strlen($string) && preg_match($pattern, strtolower($string));
    }
1284029
public function isCharset($string, $encoding)
    {
        return strtoupper($this->detect($string, [], true)) == strtoupper($encoding);
    }
1076372
public static function is_xml($string) {
        if (!defined('LIBXML_COMPACT')) {
            throw new \Exception('libxml is required to use Str::is_xml()');
        }

        $internal_errors = libxml_use_internal_errors();
        libxml_use_internal_errors(true);
        $result = simplexml_load_string($string) !== false;
        libxml_use_internal_errors($internal_errors);

        return $result;
    }
1294214
function is_utf8(&$string)
	{
		if ($string === mb_convert_encoding(mb_convert_encoding($string, "UTF-32", "UTF-8"), "UTF-8", "UTF-32")) {
			return true;
		}

		if ($this->ignore_invalid_utf8) {
			$string = mb_convert_encoding(mb_convert_encoding($string, "UTF-32", "UTF-8"), "UTF-8", "UTF-32");
			return true;
		}

		return false;
	}
703269
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);
    }
802
protected function _strlen($string)
    {
        $encoding = function_exists('mb_detect_encoding') ? mb_detect_encoding($string) : false;
        return $encoding ? mb_strlen($string, $encoding) : strlen($string);
    }
985357
public function clean($string)
    {
        if (!empty($string)) {
            $string = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $string);
            $string = htmlspecialchars(strip_tags($string, $this->_allowableTags));
            $string = str_replace('href=', 'rel="nofollow" href=', $string);

            return $string;
        }
        return false;
    }
221763
public static function isJson($string){

        if(!is_string($string)) return false;

        if(empty($string)) return false;

        json_decode($string);
        return (json_last_error() == JSON_ERROR_NONE);
    }
805657
public static function toObject($string = '')
    {

        if ($string === '') {
            return new stdClass();
        }


        if (self::isJson($string)) {
            return json_decode($string);
        }


        if (self::isXml($string)) {
            return self::xmlToObject($string);
        }

        $unserialize = self::unserialize($string);
        if ($unserialize === false) {
            return new stdClass();
        }

        if (\is_object($unserialize)) {
            return $unserialize;
        }

        return new stdClass();
    }
194912
private function isJsonMercureFormat(string $string):int
    {
        $len =  strlen($string);

        if ($len > 3 && ($string[0] == "{" && $string[$len - 1] == "}")) {
            $string = str_replace("{", "", $string);
            $string = str_replace("}", "", $string);
            $r = explode(',', $string);
            return (!in_array(" ", $r))? 1 : 0;
        }
        return (0);
    }
1243973
private function unserialize($string)
    {
        if (false === $string || null === $string || '' === $string) {
            throw new \InvalidArgumentException('Unable to unserialize value.');
        }
        set_error_handler(
            function () {
                restore_error_handler();
                throw new \InvalidArgumentException('Unable to unserialize value, string is corrupted.');
            },
            E_NOTICE
        );
        $result = unserialize($string);
        restore_error_handler();

        return $result;
    }
781607
private function isBase64($string) 
    {
        $decoded_data = base64_decode($string, true);
        $encoded_data = base64_encode($decoded_data);
        if ($encoded_data != $string) {
            return false;
        }
        return true;
    }