get_headers() (funzione PHP) recupera gli headers restituiti dal server a seguito di una chiamata HTTP.
tips&tricks
Sintassi
get_headers($url)
| parametro | descrizione |
|---|---|
| $url | L’url da processare |
Esempi
print_r(get_headers("https://code.gestiolex.it/"));
/* RISULTATO
Array
(
[0] => HTTP/1.0 200 OK
[1] => Set-Cookie: wfvt_1664692463=5aad48193b5a0; expires=Sat, 17-Mar-2018 17:23:45 GMT; Max-Age=1800; path=/; HttpOnly
[2] => Content-Type: text/html; charset=UTF-8
[3] => Link: <https://code.gestiolex.it/wp-json/>; rel="https://api.w.org/"
[4] => Link: <https://code.gestiolex.it/>; rel=shortlink
[5] => X-LiteSpeed-Cache-Control: public,max-age=1800
[6] => X-LiteSpeed-Tag: 3f11_URL.6666cd76f96956469e7be39d750cc7d9,3f11_F,3f11_Po.405,3f11_PGS,3f11_
[7] => Etag: "6497-1521305625;;;"
[8] => X-Litespeed-Cache: miss
[9] => Date: Sat, 17 Mar 2018 16:53:45 GMT
[10] => Accept-Ranges: bytes
[11] => Server: LiteSpeed
[12] => Connection: close
)
*/
Contenuti correlati
- CSS
- HTML
- JavaScript
- jQuery
- PHP
- SQL
- WORDPRESS
0 Comment