只是想知道是否有人遇到這個問題,我似乎無法修復它 - 哈哈。陣列轉換的FQL API問題?
使用Facebook FQL讓所有用戶朋友的數據,它加載90%的UID的正確,然後加載其他類似這種「http://fb.com/1.0000411781126E+14」
它縮放UID ......但我不是告訴給所有的一切。
代碼:
// run fql query
$fql_query_url = 'https://graph.facebook.com/'
. 'fql?q=SELECT%20uid%2Cfirst_name%2Clast_name%2Cname%2Cemail%2Ccurrent_location%2Cbirthday_date%2C%20contact_email%2Cusername%20FROM%20user%20WHERE%20uid%20IN%20(SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20%3D%20me())%0A'
. '&access_token=' . $access_token;
$fql_query_result = file_get_contents($fql_query_url);
$fql_query_obj = json_decode($fql_query_result, true);
// display results of fql query
// echo '<pre>';
//print_r("query results:");
//print_r($fql_query_obj);
//echo '</pre>';
?>
<table class="dynamicTable colVis table table-striped table-bordered table-condensed table-white">
<thead>
<tr>
<th>Image</th>
<th>Full Name</th>
<th>Gender</th>
<th>Locale</th>
<th>FB Email</th>
<th>Location</th>
<!-- <th>Job</th> -->
<th>Subscribers</th>
<th>SubscribedTo</th>
<th>Groups</th>
<th>Posts</th>
</tr>
</thead>
<?php
$loopvar = 1;
foreach ($fql_query_obj['data'] as $eachfriend) {
$id = $eachfriend['uid'];
$name = $eachfriend['name'];
$username = $eachfriend['username'];
//if(array_key_exists('work', $eachfriend)){
// $current_work = $eachfriend['work'][0]['employer']['name'];
//}
// else
// $current_work = "<span style='color:red;'>None</span>";
echo "<tr>";
echo "<td><a target='_blank' href='http://fb.com/".$id."'><img src='http://graph.facebook.com/" . $id . "/picture'/></a></td>";
// echo "<td><a target='_blank' href='http://fb.com/".$id."'>" . $id . "</a></td>";
echo "<td>" . $name . "</td>";
剛剛意識到我的英語是太可怕了這裏,洛爾 - 即使我加拿大人。猜猜這是在凌晨4點發生的事情:) –