hubs wrote: > I'm a total n00b. Could somebody tell me why this code doesn't work? > > <?php > > $uname = 'hubs'; > $pwd = 'bungle'; > $twitter_url = 'http://twitter.com/statuses/followers/ > hubs.xml'; > $curl_handle = curl_init(); > curl_setopt($curl_handle,CURLOPT_URL,"$twitter_url"); > curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); > curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); > curl_setopt($curl_handle,CURLOPT_USERPWD,"$uname: > $pwd"); > $buffer = curl_exec($curl_handle); > curl_close($curl_handle); > $file = "http://twitter.com/statuses/followers/hubs.xml"; > $xml = simplexml_load_file($file) or die ("Sorry Twitter is having
You should load the XML from $buffer, not $file. $xml = simplexml_load_string($buffer); ought to work. -Matt
