fsockopen()
[PHP.net] allows you to communicate with a server by providing you a handle to a stream you can read from and write to.
This "handle" is stored in the $socket
variable, it's just an identifier for the fwrite
[PHP.net] function and brothers and sisters such that it knows which stream to write to etc.
When you fwrite()
something, it gets sent to the server.