원격 이미지 파일크기 확인
stream_context_set_default( array( 'http' => array( 'method' => 'HEAD' ) ) ); $headers = get_headers($source_file); /* [0] => HTTP/1.1 200 OK [1] => Date: Sat, 29 May 2004 12:28:13 GMT [2] => Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) [3] => Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT [4] => ETag: "3f80f-1b6-3e1cb03b" [5] => Accept-Ranges: bytes [6] => Content-Length: 438 [7] => Connection: close [8] => Content-Type: text/html */ $headers = get_headers($source_file,1); /* [0] => HTTP/1.1 200 OK [Date] => Sat, 29 May 2004 12:28:14 GMT [Server] => Apache/1.3.27 (Unix) (Red-Hat/Linux) [Last-Modified] => Wed, 08 Jan 2003 23:11:55 GMT [ETag] => "3f80f-1b6-3e1cb03b" [Accept-Ranges] => bytes [Content-Length] => 438 [Connection] => close [Content-Type] => text/html */
반응형
'lang > php' 카테고리의 다른 글
Primary script unknown while reading response header from upstream (0) | 2022.03.31 |
---|---|
capture on nginx to php-fpm unix-socket (0) | 2022.03.31 |
PHP7 use NameSpace (0) | 2018.08.04 |
PHP7 Expectations - Assert() Expectations (0) | 2018.08.03 |
PHP7 CSPRNG - 암호학적으로 안전한 랜덤(pseudo-random) 함수 (0) | 2018.08.02 |