If you are using linux, it is quite simple to talk to GPS via the serial port ... Just connect your GPS using a serial cable and activate the NMEA protocol in GPS.
exec("stty -F /dev/ttyS0 9600 raw"); // Set the serial port parameters if ( !$t = fopen('/dev/ttyS0','r+b') ) // Open for read die(" - Failed to open\n"); // Send some command... fwrite($t,"Command\n"); while(true) { echo "recived: ".fgets($t,1024); }
NMEA data is as follows: $GPGLL,4916.45,N,12311.12,W,225444,A,*1D
There are many sites that describe how the NMEA protocol works, for example http://www.gpsinformation.org/dale/nmea.htm
stamp source share