WP_Session::json_in PHP Method

json_in() public method

Decodes a JSON string and, if the object is an array, overwrites the session container with its contents.
public json_in ( string $data ) : boolean
$data string
return boolean
    public function json_in($data)
    {
        $array = json_decode($data);
        if (is_array($array)) {
            $this->container = $array;
            return true;
        }
        return false;
    }