-2
我想從json中提取一些數據,然後卡住了。在JSON這裏開始:從json中提取php數據
{torrent: "",rss: {channel: {title: "The Pirate Bay - TV shows",link: "test"}}}
,在這裏我的代碼:
<?php
require_once 'rss_php.php';
$rss = new rss_php;
$rss->load('http://rss.thepiratebay.se/205');
$jsonData = json_encode($rss->getRSS());
$phpArray = json_decode($jsonData);
foreach ($phpArray as $key => $value) {
echo "<p>$key | $value</p>";
}
?>
所有返回是
Torrent|
如何繞過激流: 「」。
什麼是'rss_php.php'? – JavaCake
'$ some_var = json_decode(json_encode($ some_other_var));'?嗯... ... – jeroen
'$ rss-> getRSS()'返回什麼? – jeroen