I'm brand new to this forum and I'm hoping several of the more experienced here can help me with my question. My question concerns using PHP as a standalone client-side program rather than its traditional role as a server-side page processing tool. I realize that PHP is probably not a first choice as a tool for a server-side programming job, but I'm very familiar with PHP, and therefore it would certainly speed up development of the application I have in mind. I know I could use a language such as Python, or C++ to do the job, but I am not sure I can afford the time to get up the learning curve. And then there is always the confusion factor of trying to go back and forth between two different languages at the same time, but for different jobs.
I have been successfully using PHP as a scripting language for generating webpages in conjuction with HTML, where a program takes the output of some form data, processes it, and displays it on the screen. I have also created PHP page that contain code snippets which displays the output from one or more tables in a database when a user accesses the page. But the PHP programs I have created all end with a single page being displayed. That is, until some action creates another page. What I need is a program that runs continually collecting data and updating a display page until such time as I manually stop it.
To be more specific, what I have in mind is developing a program that will be able to read the textual data (NMEA) streaming from a GPS receiver through a serial port (USB) on a continual basis, and update a display page after each read, which come at about one second intervals. The program would need to parse the incoming data stream as data filled the serial buffer, use the parsed data to update the records of a MySQL database, and graphically update the positional data on a display screen, all without user intervention. I know I can do all of the pieces that need to be done, because I've used PHP to do similar thing in other programs. What I'm not sure of is how best to use PHP as a continually running and updating program as opposed to a batch-mode type of program.
The computer I am planning to use would be running Linux, and the Apache server would be devoted entirely to running just the programs associated with the project. Any suggestions on how to go about this would be greatly appreciated.