openssl_pkey_export

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Gets an exportable representation of a key into a string
<?php openssl_pkey_export(    OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $key,    string &$output,    ?string $passphrase = null,    ?array $options = null): bool
<?php echo $out;



$passphrase = isset($argv[2]) ? $argv[2] : null;

openssl_pkey_export($privkey, $out, $passphrase);

echo $out;