如何让PHP bot打印出标题

$instagram = "ugur2d";
$kaynak = file_get_contents("https://www.instagram.com/$instagram/"); 
preg_match('@<title>(.*?)</title>@si', $kaynak, $iglink);
echo $iglink[1];

Screen is empty. How can i run it?

After some checkings... your url returns error 404 - file_get_contents will return false if 404 is returned by the server (instagram returns a 404 error page if profile does not exist)

thats why you dont get any result!

anyway you should use curl instead!

Okey okey okey. Im fixed problem. Answer -> CURL :D

$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'https://toosba.com/',
    CURLOPT_USERAGENT => "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => FALSE
]);

$source = curl_exec($ch);

curl_close($ch);

preg_match('/<title>(.*?)<\/title>/', $source, $title);

print_r($title);
echo "<hr>".$title[1];

Thank you :)