Worked perfectly, thanks!
I'm trying to add something, but I can't seem to see where I'm going wrong. The idea here is to pull the Alexa data and add it to the array. If possible, I'd like to add it in the position of one of the elements I removed.
Code: Select all
foreach ($gd_data as $key => $value) {
unset($gd_data[$key][1]);
unset($gd_data[$key][4]);
$url = $gd_data[$key][0];
$querystring = 'http://xml.alexa.com/data?cli=10&dat=nsa&ver=quirk-searchstatus&uid=19700101000000&userip=127.0.0.1&url='.urlencode($url);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $querystring);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$alexaxml = curl_exec($ch);
curl_close($ch);
$alexa_pop = get_string_between($alexaxml, "\" TEXT=\"", "\"/>");
$alexa_pop = number_format($alexa_pop);
array_push($value, $alexa_pop);
}
Any ideas?