views:

31

answers:

1

Title should say my words.Here is my basic code...

    <?php 

require_once 'fb-sdk/src/facebook.php';

// Create our Application instance.
$facebook = new Facebook(array(
  'appId'  => 'xxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxx',
  'cookie' => true,
));


$accessToken = $facebook->getAccessToken();
$session = $facebook->getSession();
$uid = $facebook->getUser(); 
 //echo "https://graph.facebook.com/".$uid."/friends/?access_token=".$accessToken;

$frnd = $facebook ->api('/me/friends?access_token='.$accessToken);
echo $frnd["data"][0]["name"]; 
?>

But it returns a peculiar output.



Could any one tell me where the problem is?

A: 

 is BOM header: See: http://en.wikipedia.org/wiki/Byte_order_mark (you should encode your file as uff-8 without bom)

This means your code isn't outputting anything.

Arnar Yngvason
Yes,converting to utf-8 w/o bom solve peculiar issue.But why my code isnt working??
neo-nant