How to get file_get_contents() to work with HTTPS?

后端 未结 12 2206
长发绾君心
长发绾君心 2020-11-21 23:38

I\'m working on setting up credit card processing and needed to use a workaround for CURL. The following code worked fine when I was using the test server (which wasn\'t cal

12条回答
  •  感动是毒
    2020-11-22 00:33

    TO CHECK IF AN URL IS UP OR NOT

    The code in your question can be rewritten as to a working version:

    function send($packet=NULL, $url) {
    // Do whatever you wanted to do with $packet
    // The below two lines of code will let you know if https url is up or not
    $command = 'curl -k '.$url;
    return exec($command, $output, $retValue);
    }
    

提交回复
热议问题