This example uses an EM-506 GPS module and google map to get and show latitudes and longitudes.

EM-506 GPS module

Click image for larger version

Name:	004.jpg
Views:	49
Size:	79.5 KB
ID:	87

EM-506 uses an NMEA protocol to give information through its UART(4,800bps).
Latitudes and longitudes are read from a GGA(Global Positioning System Fixed Data) output command and marked the coordinate on google map.
The image below shows you how to connect EM-506 to PHPoC Blue.

Click image for larger version

Name:	003.png
Views:	53
Size:	160.6 KB
ID:	88


Source code - Index.php
PHP Code:
<?php
include_once "/lib/sd_340.php";

$gps_cmd _GET("gps");

$latitude 0.0;
$longitude 0.0;

if(
$gps_cmd == "read")
{
    
uart_setup(04800);

    
$msg "";

    while(
1)
    {
        
$rbuf "";
        
$read uart_read(0$rbuf);
        if(
$read 0)
        {
            
$msg .= $rbuf;
            if(
strpos($msg"\r\n") !== false)
            {
                
$idx strpos($msg"\r\n");
                
$cmd substr($msg0$idx);

                if(
strpos($cmd"$") !== false)
                {
                    
$idx strpos($cmd"$");
                    if((
$m_id substr($cmd$idx 15)) !== false)
                    {
                        if(
$idx 0)
                        {
                            
$cmd substr($cmd$idx);
                        }
                        if(
$m_id == "GPGGA")
                        {
                            
$cmd_crc str_replace("$"""$cmd);
                            
$cmd_crc str_replace("*"""$cmd_crc);

                            
$crc 0;
                            
$len strlen($cmd_crc);
                            for(
$i 0;$i $len 2;$i++)
                                
$crc ^= bin2int($cmd_crc[$i], 01);

                            
$str_crc substr($cmd_crc$len 2);

                            if(
bin2int(hex2bin($str_crc), 01) == $crc)
                            {
                                
$arr explode(","$cmd);

                                
$latitude = (int)substr($arr[2], 02) + (float)substr($arr[2], 27) / 60;
                                
$longitude = (int)substr($arr[4], 03) + (float)substr($arr[4], 37) / 60;
                                break;
                            }
                        }
                    }
                }
                
$msg "";
            }
        }
    }
}

?>
HTML Code:
<!DOCTYPE html>
<html>
  <head>
    <title>P4S-342</title>
  </head>
  <body align=center>
      <a href="index.php?gps=read">Read GPS</a><br>
      <?php
          if($gps_cmd == "read")
          {
              printf("GPS - Latitude: N%.4f, Logitude: E%.4f<br><br>", $latitude, $longitude);
              printf("<a href=http://maps.google.com/?q=%f,%f&amp;hl=en target=_g_map>View in Google Map</a>", $latitude, $longitude);
        }
      ?>
  </body>
</html>

Video