protected $usersToClients = [];
public function onMessage(ConnectionInterface $from, $msg) {
$msg = json_decode($msg);
if (property_exists($msg, 'auth')) {
$usersToClients[$msg->auth] = $from;
} else {
if (isset($usersToClients[$msg->toUser])) {
$usersToClients[$msg->toUser]->send($msg->message);
}
}
}
<?php}
{?>
}?>
<?php }
{ ?>
} ?>
header('X-Accel-Redirect: ' . $file);
header('Content-Disposition: attachment; filename=' . basename($file));
header('X-SendFile: ' . $file);
header('Content-Disposition: attachment; filename=' . basename($file));
header('X-Accel-Redirect: ' . $file);
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . basename($file));
exit;
header('X-SendFile: ' . realpath($file));
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . basename($file));
exit;
$result = [];
$file = file_get_contents('file.txt');
$rows = explode('\n', $file);
$titles = explode('\t', array_shift($rows));
foreach ($rows as $row) {
$cols = explode('\t', $row);
for ($i=0; $i<count($titles); $i++) {
if (isset($cols[$i])) {
$cols[$titles[$i]] = $cols[$i];
unset($cols[$i]);
}
}
$result[] = $cols;
}
$first_names = array_column($result, 'first_name');
print_r($first_names);