ホーム > タグ > socket

socket

cakephpでhttp通信し、xmlを取得して配列に入れる処理

cakephpを最近よくいじるのでその備忘録

App::import('HttpSocket');
App::import('Xml');
$http=&newHttpSocket();
$xml=&newXML($http->get('http://www.sj6.org/feed/'));
$xml=Set::reverse($xml);
pr($xml);

ほら、簡単でしょ!
と思ったら、こういう方法もあった

uses('Xml');
$xml = new XML("http://www.sj6.org/feed/");
$xml_array = Set::reverse($xml);
pr($xml);

楽チンやね。

関連記事

Home > Tags > socket

フィードとか

ページの上へ