I'm not familiar with the API, but if you have a javascript one, and that's it, you would have to have something with the Javascript pass the information back to the server for the PHP backend to use. PHP, and any other server-side scripting language, cannot access anything from the client, other than what is passed in the HTTP headers when it does a page request.
The easiest thing to do would be to have a page the user has to hit first, with the bit of JS picking up the coordinates, then form a URL (ie: http://my.location/index.php?lat=12.45&long=67.89) and redirect to that. This would happen as soon as the user visits.
<?php
if (!isset($_GET['long']) && !isset($_GET['lat'])) {
?>
<source type='text/javascript'>
// Do the redirect here
</source>
<?php
} else {
$latitude = $_GET['latitude'];
$longitude = $_GET['longitude'];
?>
<!-- All your HTML, logic, etc. goes here -->
<?php
}
?>