【问题标题】:Error when I try to print value of an openssl_csr_get_subject当我尝试打印 openssl_csr_get_subject 的值时出错
【发布时间】:2021-06-28 09:35:11
【问题描述】:

我正在尝试解码表单发送的 .csr。我的 sn-p 示例如下:

    $csr=$_POST["elcsr"];
    $data=openssl_csr_get_subject($csr);
    $email = array_values($data)[6];
    echo $email;

但我尝试打印电子邮件失败并出现以下错误:

Warning: array_values() expects parameter 1 to be array, bool given in C:\wamp644\www\proyecto1\back-end\castellano\decodificado.php on line 16

我不知道发生了什么......

提前致谢

【问题讨论】:

    标签: php html forms ssl csr


    【解决方案1】:

    正如您在openssl_csr_get_subject 的官方PHP 文档中看到的,如果发生错误,此函数可能会返回false。因此,在将其提交给该函数之前,您需要检查并验证在“elcsr”中发布到脚本的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-13
      相关资源
      最近更新 更多