【发布时间】:2011-10-09 21:55:24
【问题描述】:
我有两个文件,index.php 和一个 callback.php。 Index.php 用于在网站上显示数据。 callback.php 是一个充当监听器的脚本。 callback.php 由服务器调用,callback.php 中的$update 变量由服务器实时更新。我想在每次更新时查看 $update 变量的内容。
回调.php:
if ($method == 'GET' && $_GET['hub_mode'] == 'subscribe' &&
$_GET['hub_verify_token'] == VERIFY_TOKEN) {
echo $_GET['hub_challenge'];
} else if ($method == 'POST') {
$updates = json_decode(file_get_contents("php://input"), true);
//I want to see the content of $updates
// resend the push notification again.
error_log('updates = ' . print_r($updates, true));
}
我该怎么做?请告诉我。如果您有一些我可以开始的示例代码,我将不胜感激。
【问题讨论】:
标签: php facebook real-time server-side