だから私は、このプライベート関数があります。PHPのカールは、XMLフィードは、すべてのデータを返しません取得する
private function curl_get($url)
{
// Initiate the curl session
$ch = curl_init();
// Set the URL
curl_setopt($ch, CURLOPT_URL, $url);
// Removes the headers from the output
curl_setopt($ch, CURLOPT_HEADER, 0);
// Return the output instead of displaying it directly
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
// Execute the curl session
$output = curl_exec($ch);
// Close the curl session
curl_close($ch);
return $output;
}
をそして、このリンクで、たとえば場合、私は使用:http://www.metacafe.com/api/item/cb-xuFyGC0jJqPfhMoFnewj4Da_ZhHCz4L2/は
今の問題はdoesnのことです
[data] => SimpleXMLElement Object
(
[@attributes] => Array
(
[version] => 2.0
[source] => Metacafe
)
[title] => Metacafe
[channel] => SimpleXMLElement Object
(
[title] => SimpleXMLElement Object
(
)
[link] => http://www.metacafe.com/watch/cb-GKeDVFevZxk_rNri_uz_K01azz3uV_ZZ/
[image] => SimpleXMLElement Object
(
[url] => http://s.mcstatic.com/Images/MCLogo4RSS.jpg
[link] => http://www.metacafe.com
[title] => Metacafe
[height] => 65
[width] => 229
)
[description] => SimpleXMLElement Object
(
)
[item] => SimpleXMLElement Object
(
[id] => cb-GKeDVFevZxk_rNri_uz_K01azz3uV_ZZ
[author] => CBS
[title] => Romney Concedes South Carolina Primary
[link] => http://www.metacafe.com/watch/cb-GKeDVFevZxk_rNri_uz_K01azz3uV_ZZ/romney_concedes_south_carolina_primary/
[rank] => 4.00
[category] => News & Events
[description] => SimpleXMLElement Object
(
)
[guid] => http://www.metacafe.com/watch/cb-GKeDVFevZxk_rNri_uz_K01azz3uV_ZZ/romney_concedes_south_carolina_primary/
[pubDate] => 18 hours ago +0000
)
)
)
は、なぜそれが私にとってかなり重要である、説明とタグを返していません:?「tは私が得るすべてはこれです、すべてのデータを返しますか
ああ、...私はXMLに新しいですし、あなたに新しいおかげで何かを学び、また、溶液を得たことを知りませんでした。 – Alex
私は今、[説明]のデータ(タグ、説明、提出)を分離するためにpreg_matchを実行するだけです。 – Alex