function getposts($search){
$url = "http://search.twitter.com/search.json?q=".$search."&include_entities=true&result_type=mixed";
$value = file_get_contents($url);
$array = json_decode($value, true);
foreach($array['results'] as $id){
$uniquearray[] = array_unique($id);
}
for($i=0;$i<count($uniquearray);$i++){
$output .= $uniquearray[$i]['from_user_id'];
$output .= "<br />";
}
return $output;
}
Thats what I tried but it doesnt seem to work it just gets the last post now and I think thats because it filters all the values from every user and since some of them are from a different user but with another key the same value it removes them. I only want to avoid duplicate from_user_id key values.
Can someone help me out with this? I am using a twitter api. And using this url:
http://search.twitter.com/search.json?q=apitesttweet&include_entities=true&result_type=mixed