socket_write()
socket_write - Write to a socket
Syntax
int socket_write (
resource $socket,
string $buffer,
int $length)
Arguments
- socket
- buffer - The buffer to be written.
- length - The optional parameter length can specify an alternate length of bytes written to the socket. If this length is greater then the buffer length, it is silently truncated to the length of the buffer.
Description
The function socket_write() writes to the socket from the given buffer.
Version
PHP 4.1.0, 5
Return value
Returns the number of bytes successfully written to the socket or FALSE on failure. The error code can be retrieved with socket_last_error(). This code may be passed to socket_strerror() to get a textual explanation of the error.