Horje
php file_get_contents follow redirect Code Example
php file_get_contents follow redirect
$context = stream_context_create(
    array(
        'http' => array(
            'follow_location' => true/false
        )
    )
);

$html = file_get_contents('http://www.example.com/', false, $context);

var_dump($http_response_header);
file_get_contents follow redirect
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$a = curl_exec($ch);
if(preg_match('#Location: (.*)#', $a, $r))
 $l = trim($r[1]);




Php

Related
wordpress get current user role Code Example wordpress get current user role Code Example
php get file extension from filename Code Example php get file extension from filename Code Example
php object to array Code Example php object to array Code Example
wordpress loop permalink Code Example wordpress loop permalink Code Example
php reverse array Code Example php reverse array Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7