- print_r: documentation ( source)
<?php
$privateKey = openssl_pkey_new([
'private_key_bits' => 2048,
//'private_key_type' => OPENSSL_KEYTYPE_RSA, // RSA is default
//'encrypt_key' => true // we don't want encryption
]);
print_r($privateKey);