我使用json代码,当我运行程序时不显示任何内容。只是银行页面,请帮我解决 这是我的代码
<!DOCTYPE html>
<html>
<head>
<title>Percobaan</title>
</head>
<body>
<form method="post" action="#">
<input type="text" id="scrap" name="scrap" placeholder="Input Hashtag ex: malang">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
<?php
if (isset($_POST['scrap'])) {
$hashtag=$_POST['scrap'];
$html=file_get_contents("https://mobile.twitter.com/search?q=%23".$hashtag."&src=typeahead_click");
$json=json_decode($html,true);
print_r($json);
}
?>
答案 0 :(得分:0)
The response is not JSON data, it is just an HTML content, you can only parse the JSON content through the valid JSON data.