php8.5
Home/ Manual/ openssl / functions/ openssl_x509_export_to_file

openssl_x509_export_to_file

PHP function Edit on GitHub ✎

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

Exports a certificate to file

Description

openssl_x509_export_to_file(OpenSSLCertificate|string $certificate, string $output_filename, bool $no_text = true): bool

openssl_x509_export_to_file() stores certificate into a file named by output_filename in a PEM encoded format.

Parameters

output_filename

Path to the output file.

no_text

Param-notext

Return Values

Success

Changelog

VersionDescription
8.0.0certificate accepts an OpenSSLCertificate instance now; previously, a Resource of type OpenSSL X.509 was accepted.

Source: reference/openssl/functions/openssl-x509-export-to-file.xml · from the official PHP manual (php/doc-en)