Script taken from http://css-tricks.com/snippets/php/get-geo-ip-information/
.
.
.
//Array where results will be stored
$ipInfo=array();
//check response from ipserver for above patterns
foreach ($patterns as $key => $pattern)
{
//store the result in array
$ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : 'not found';
}
return $ipInfo;
}
This displays the $ipInfo.
The thing is that i don't want it to display $ipInfo. I want to save the output in a variable and then echo it later, when i need it in another place. How can i do that?