I tried to get the source code of the following Facebook page - https://www.facebook.com/video.php?v=974372955923474&set=vb.213776828649761&type=2&theater. But it never returns the source code for the actual page, instead, it returns a source code which forms a 'Update your browser' page, it seems that I have used the wrong user-agent, but I changed the user agent to the newest version of Chrome and it still not working.
// Set curl option - following location - prevent redirects
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// Set curl option - retransfer
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set curl option - no header
curl_setopt($ch, CURLOPT_HEADER, false);
// Set curl option - no body
curl_setopt($ch, CURLOPT_NOBODY, false);
// Set curl option - user agent
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"); // Necessary. The server checks for a valid User-Agent.
// Execute CURL and get the response
$curlResponse = curl_exec($ch);