无法使用 PHP ob_start 捕获 curl 响应

问题描述

我正在尝试使用 ob_start/ob_get_clean() 在 PHP 中捕获 curl 调用的原始输出

尽管使用了 ob_start(),但它仍会回显到命令行,并且 $response 为空白。

这是我使用的代码

$call = 'curl -k --verbose http://example.com/';
                ob_start();
                $notthisEither = `$call`;
                $response = ob_get_clean();
                echo $response;  // nothing
                echo $notthisEither; // nothing

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)