I need to query SocialMention.com for "Colorado Springs" and "District 11" and pull the data back into a CSV file. I'm an old programmer but new to PHP and JSON. Here's the simple php code:
<?php
$curl = curl_init('http://api.socialmention.com/search?q=%22colorado+springs%22+%22district+11%22&f=json&src[]=twitter&sentiment=true&meta=info');
$result = curl_exec($curl);
echo $result;
?>
How do I parse $result and store it in a CSV file? I've been researching this for 6 days and have tried every example I can find with no luck. In the examples below I keep getting an "Invalid argument in foreach" error.