使用未定义的常量share_count - 假设' share_count'在第10行的C:\ xampp \ htdocs \ Opinion_Mining \ get_data.php中

时间:2018-03-24 07:55:34

标签: php

无法找到解决方案

<?php

if (isset($_POST['submit'])) {

    $url = $_POST['url'];

    $rest_url = "http://api.facebook.com/restserver.phpformat=json&method=links.getStats&urls=" . urlencode($url);

    $json = json_decode(file_get_contents($rest_url), true);

    echo "Facebook Shares = " . $json[0][share_count];

    echo "Facebook Likes = " . $json[0][like_count];

    echo "Facebook Comments = " . $json[0][comment_count];
}
?>

0 个答案:

没有答案