<?php $id='amperka.ru'; $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n", "Cookie: foo=bar\r\n" ) ); $context = stream_context_create($opts); // Open the file using the HTTP headers set above $file = file_get_contents('https://www.facebook.com/plugins/fan.php?connections=100&id='.$id, false, $context); //echo $file; $target = '_1drq'; $target1 = ';">'; $target2 = ' '; $pos = strstr($file, $target); $pos = strstr($pos, $target1); $pos = strstr($pos, $target2, true); $pos = substr($pos, strlen($target1)); print('fan_count='); print_r($pos); //echo $pos; ?>