file_get_contents获取HTTPS内容

后端开发   发布日期:2023年05月06日   浏览次数:498
  1. <?
  2.  
  3. header("Content-Type: text/html;charset=GB2312");
  4. session_start();//开启session功能
  5. date_default_timezone_set ("PRC");//设置时区
  6. set_time_limit(0);
  7.  
  8. $var_url = 'https://www.19jp.com';
  9.  
  10. $arrContextOptions = [
  11.     'ssl' => [
  12.         'verify_peer' => false,
  13.         'verify_peer_name' => false,
  14.     ]
  15. ];
  16. $getv = file_get_contents($var_url, false, stream_context_create($arrContextOptions));
  17.  
  18.  
  19. if ( strpos( $getv, "-49.mp4" ) !== false ) {
  20. ?>
  21. <audio id="bgmp3" autoplay loop>
  22. <source src="yinsu_1.mp3" type="audio/mpeg">
  23. </audio>
  24. <?
  25. }else{
  26. echo date("Y-m-d H:i:s").'-监控中......';
  27. }
  28.  
  29. ?>


以上就是file_get_contents获取HTTPS内容的详细内容,更多关于file_get_contents获取HTTPS内容的资料请关注九品源码其它相关文章!