I am trying to retrieve the latitude and longitude fields from the user's location.
I know that these are part of the array that makes up the user object but I cannot figure out a way to break them out.

I have been doing searches on the drupal site for a few hours now, and have come up with some promising leads.

This code (found here http://drupal.org/node/403594) :

<?php
global $user;
$viewinguser = user_load(array('uid' => $user->uid));
print_r($viewinguser);
?>

Will print out the complete user object with the location fields I want to get, but I do not know how to access them in the array and retrieve them.

I am working on my php skills, but this problem has me hooped. Anybody care to offer me some insight?
Thanks in advance.

Below is what the above code prints out when placed in a node.

stdClass Object ( [uid] => 1 [name] => admin [pass] => 7f9183e3e1d1c5e45cb912076c6e3059 [mail] => john@test.ca [mode] => 0 [sort] => 0 [threshold] => 0 [theme] => [signature] => [signature_format] => 0 [created] => 1247602335 [access] => 1254367892 [login] => 1254357433 [status] => 1 [timezone] => -25200 [language] => [picture] => [init] => john@test.ca [data] => a:1:{s:13:"form_build_id";s:37:"form-5689e0bb8b10494a55af7d43997335e8";} [timezone_name] => [form_build_id] => form-5689e0bb8b10494a55af7d43997335e8 [roles] => Array ( [2] => authenticated user ) [locations] => Array ( [0] => Array ( [lid] => 3 [name] => [street] => 1000 Granville Street [additional] => [city] => Vancouver [province] => BC [postal_code] => [country] => ca [latitude] => 49.279232 [longitude] => -123.123041 [source] => 3 [is_primary] => 0 [province_name] => British Columbia [country_name] => Canada ) ) [location] => Array ( [lid] => 3 [name] => [street] => 1000 Granville Street [additional] => [city] => Vancouver [province] => BC [postal_code] => [country] => ca [latitude] => 49.279232 [longitude] => -123.123041 [source] => 3 [is_primary] => 0 [province_name] => British Columbia [country_name] => Canada ) )