PHP comes with a very capable socket programming API.
I have copied Client/Server Socket Program from the following source http://www.php.net/manual/en/sockets.examples.php …