YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Tech > PHP
검색
멤버이름    오토
비밀번호 
 

리모트 파일 헤더값가져오기

페이지 정보

작성자 MintState 댓글 0건 조회 5,355회 작성일 18-05-17 14:17

본문

리모트 파일 헤더값가져오기

방법 1.
$headers=get_headers("http://a0000001122.site/video0/id_231.algwqh");
print_r($headers);


방법 1.
class URIInfo 
{
    public $info;
    public $header;
    private $url;

    public function __construct($url)
    {
        $this->url = $url;
        $this->setData();
    }

    public function setData() 
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $this->url);
        curl_setopt($curl, CURLOPT_FILETIME, true);
        curl_setopt($curl, CURLOPT_NOBODY, true);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_HEADER, true);
        $this->header = curl_exec($curl);
        $this->info = curl_getinfo($curl);
        curl_close($curl);
    }
}

$uri_info = new URIInfo('http://a0000001122.site/video0/id_231.algwqh');
if (preg_match('/Not Found/i', $uri_info->header))
	echo "Not Found!!!";
else 
	print_r($uri_info->header);

댓글목록

등록된 댓글이 없습니다.

Total 165건 1 페이지
PHP 목록
번호 제목 글쓴이 조회 날짜
열람중 MintState 5356 05-17
164 MintState 6037 05-11
163 MintState 6208 04-05
162 MintState 6353 04-03
161 MintState 8173 01-18
160 MintState 6957 08-08
159 MintState 10228 07-31
158 MintState 7908 05-29
157 MintState 6981 02-22
156 MintState 8347 02-21
155 MintState 12232 11-12
154 MintState 9246 12-08
153 MintState 13169 02-26
152 MintState 17450 01-22
151 MintState 11701 07-27
150 MintState 13892 02-10
149 MintState 13299 10-21
148 MintState 17366 05-02
147 MintState 22051 04-18
146 MintState 14880 04-17
145 MintState 15317 04-17
144 MintState 14534 03-14
143 MintState 16206 03-04
142 MintState 16921 01-18
141 MintState 20118 07-02
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™