Well this is a PHP board, so I dont think we can help you with this... PHP doesnt talk to any hardware.
Serial communication in general depends, on Operating System and Programing Language. For instance Java probably has a nice Object Heirarchy for talking to the serial port (JVM does all the nasty work), C++ probably has somewhat of the same thing, except its just some library you can include.
Hope that helps!