Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何获取https的内容(带或不带curl)?_Php_Curl - Fatal编程技术网

Php 如何获取https的内容(带或不带curl)?

Php 如何获取https的内容(带或不带curl)?,php,curl,Php,Curl,有人能告诉我如何使用curl或不使用curl获取https的内容吗?不使用curl,您可以使用openssl s_client-connectservername:port@BartFriederichs:Can您能给我完整的代码吗?@BhavnishNarang它是一个命令行命令,与SSL主机通信的方式与Telnet与普通主机通信的方式相同。剩下的就交给你去实施了。提示:您必须自己实现HTTP协议。@rikesh:我什么也没试过,兄弟……我想要完整的代码$ch=curl\u init();cu

有人能告诉我如何使用curl或不使用curl获取https的内容吗?

不使用curl,您可以使用
openssl s_client-connectservername:port
@BartFriederichs:Can您能给我完整的代码吗?@BhavnishNarang它是一个命令行命令,与SSL主机通信的方式与Telnet与普通主机通信的方式相同。剩下的就交给你去实施了。提示:您必须自己实现HTTP协议。@rikesh:我什么也没试过,兄弟……我想要完整的代码$ch=curl\u init();curl_setopt($ch,CURLOPT_头,1);curl_setopt($ch,CURLOPT_VERBOSE,1);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);curl_setopt($ch,CURLOPT_FAILONERROR,0);curl_setopt($ch,CURLOPT_HTTPAUTH,CURLAUTH_ANY);curl_setopt($ch,CURLOPT_USERPWD,“$username:$password”);curl_setopt($ch,CURLOPT_URL,$fullurl);我们必须在用户名和密码中写入的内容。。。