require_once 'library/facebook/facebook.php';
$facebook = new Facebook(array(
'appId' => 'appid',
'secret' => 'secret',
));
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
以上代码后如何获取UID。