praneeth praneeth - 11 months ago 79
PHP Question

file_get_contents() for short urls

doesn't read data for short urls



Please help me in handle this. OR Is there any CURL function to handle above links?


This in general works fine. If you find it doesn't do the right thing you can explicitly use a stream context:

$url = "";
$context = stream_context_create(array('http' => array('max_redirects' => 5)));
$val = file_get_contents($url, false, $context);

should do it. No need to touch CURL for that.