openssl_pkcs7_read

Supported Versions: PHP 7 >= 7.2.0, PHP 8
Export the PKCS7 file to an array of PEM certificates
<?php openssl_pkcs7_read(string $data, array &$certificates): bool