Hi everyone, I'm new study Facebook api. I use this code, but the resault is empty. Can anyone help me? Thanks.
ps: i have replaced my api id, url ,secrect in it.

<form action ="index.php" method ="post">
<input type="text" value="what is?" name="search" style="color:#999;text-align:center;" onfocus="if (value =='what is?'){value =''}" onblur="if (value ==''){value='what is?'}"/>
<input type ="submit" value="ok" />
</form>
<?php
function callFb($url)
{
    $ch = curl_init();
    curl_setopt_array($ch, array(
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true
    ));

    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}

$url = "https://graph.facebook.com/oauth/access_token?client_id=api_id&redirect_uri=my_url&client_secret=my_secrect&scope=offline_access,read_stream";
$access_token = callFb($url);
$access_token = substr($access_token, strpos($access_token, "=")+1, strlen($access_token));

$url1 = "https://graph.facebook.com/search?access_token=".$access_token."&q=".urlencode($_POST['search'])."&type=user";
$ret_json = callFb($url1);
$users = json_decode($ret_json, true);

?>

<img src="https://graph.facebook.com/<? echo $users[data][0][id]; ?>/picture?type=small">