Jump to content

ak111in

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by ak111in

  1. Hi, I want to get the list of twitter followers in xml form using the url http://api.twitter.com/1/followers/ids.xml?cursor=-1&screen_name=amodkumargupta I am using the code <?php $xml = new SimpleXMLElement('http://api.twitter.com/1/followers/ids.xml?cursor=-1&screen_name=amodkumargupta',NULL,TRUE); foreach ($xml->ids->id as $id) { echo "Found $id<br />"; } ?> But getting the following error: Someone please help with the error.
  2. xml file: <PRICES> <PRICE> <WIC>HDE0AAFGRBOX</WIC> <STOCK>100+</STOCK> <MY_PRICE>219.00</MY_PRICE> </PRICE> </PRICES> php file: <? $filexml='stock.xml'; if (file_exists($filexml)) { $xml = simplexml_load_file($filexml); $f = fopen('stock.csv', 'w'); foreach($xml->PRICES->PRICE as $price) { fputcsv($f, get_object_vars($price),',','"'); } fclose($f); } ?> Error: Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\stock.php on line 6 Please help with this.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.