I'm trying to make an xmlhttp request and print out the xml. I created a class with methods and am calling those methods from an object. However, when I attempt to print the output of the method, I get nothing. I'm guessing it's something minor, but I've been trying for awhile now and have made little progress. Thanks in advance for the help.
<?php
class twitter {
public $screen_name;
public $xml;
public $count;
public function getUserTimeline($screen_name, $count=5) {
$request= "https://api.twitter.com/1/statuses/user_timeline.xml?include_entities=true&include_rts=true&screen_name=$screen_name&count=$count";
return $this->makeRequest($request);
}
public function makeRequest($request){
return $xml = simplexml_load_file($request);
}
}
$test = new twitter;
$test->screen_name="mattcutts";
$test->getUserTimeline($screen_name=$test->screen_name, $count=5);
print_r($test->xml); //This does not print anything.
?>