public static function toJson(array $array, bool $prettyPrint = true, bool $unescapedSlashes = true): string
    {
        $options = 0;
        if ($unescapedSlashes) {
            $options += JSON_UNESCAPED_SLASHES;
        }
        if ($prettyPrint) {
            $options += JSON_PRETTY_PRINT;
        }
        return json_encode($array, $options);
    }
public static function toJson(array $array, bool $prettyPrint = true, bool $unescapedSlashes = true): string
    {
        $options = 0;
        if ($unescapedSlashes) {
            $options += JSON_UNESCAPED_SLASHES;
        }
        if ($prettyPrint) {
            $options += JSON_PRETTY_PRINT;
        }
        return json_encode($array, $options);
    }
public static function toJson ( array $ array , bool $ prettyPrint = true , bool $ unescapedSlashes = true ) : string { $ options = 0 ; if ( $ unescapedSlashes ) { $ options += JSON_UNESCAPED_SLASHES ; } if ( $ prettyPrint ) { $ options += JSON_PRETTY_PRINT ; } return json_encode ( $ array , $ options ) ; }
To json.

@param mixed[] $array
@param bool $prettyPrint
@param bool $unescapedSlashes
@return string
To json .