随笔分类 - php
摘要:1 <?php 2 $url = $_GET['url']; 3 //获取视频url 4 $url = get_redirect_url($url); 5 //获取视频ID 6 $str = dirname($url); 7 $id = substr($str,strripos($str,'vide
阅读全文
摘要:函数说明 可以直接获取网址重定向 (302,301) 之后的地址 函数源码 function get_location($url,$ua=0){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURL
阅读全文
摘要:1. 爬取页面数据 $url = "http://www.zongscan.com/demo333/178.html"; $request = new GuzzleRequest('GET', $url); $client = new \GuzzleHttp\Client(); $response
阅读全文