PHP 8.5.0 RC4 available for testing

Voting

: max(nine, seven)?
(Example: nine)

The Note You're Voting On

Timofey Bugaevsky
2 years ago
Good example from Javier.

For using in docker container you can use 0 as an address:
$address = '0';

To broadcast a message to all clients, you can use socket_write() for all required clients:
...
// Handle Input
foreach ($clients as $key => $client) {
if (in_array($client, $read)) {
...
if ($buf == 'message') {
$talkback = "$buf $key\n";
foreach ($clients as $curClient) {
socket_write($curClient, $talkback, strlen($talkback));
}
continue;
}
...
}
}
...

<< Back to user notes page

To Top