I am extracting XML from a feed. There is a tag entitled:
<georss:point>34.234 -34.435</georss:point>
which contains two variables I am inserting into MySQL When I run this code, the variable is 'array'. I then place an extract to break out the variables, unsure of next
$xmlString = str_replace('georss:point','point',$xmlString);
$xml = new SimpleXMLElement($xmlString);
$items = $xml->xpath('channel/item');
$closeItems = array();
foreach($items as $item)
{
$latlng = explode(' ',trim($item->point));
array(
'lat'=>$latlng[0],
'lng'=>$latlng[1]
);
$lat = array($latlng[0]);
$lng = array($latlng[1]);
echo $lat;
echo $lng;
}
When I place those echo statements (in the last two lines of code), the variables get echod to the screen. However when I place these varaibles outside of the array, the values do not get echod. I am attempting to get these variables outside of the array, so that I can insert these variables into the database. I have tried extract on the varaiables, but this prints back to the screen as 'Array'... unsure of what I need to do to extract these variables from the array. Thanks,