We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 案例 14. PHP [socket初探中](https://github.com/elarity/advanced-php/blob/master/14.%20PHP%20socket%E5%88%9D%E6%8E%A2%20---%20%E5%90%AB%E7%9D%80%E6%B3%AA%E4%B9%9F%E8%A6%81%E7%A3%95%E5%AE%8Clibevent%EF%BC%88%E4%B8%89%EF%BC%89.md) 聊天代码里 // 这里值得注意,我们声明两个数组用来保存 事件 和 连接socket $event_arr = []; $conn_arr = []; // 此处值得注意,我们需要将事件本身存储到全局数组中,如果不保存,连接会话会丢失,也就是说服务端和客户端将无法保持持久会话 $event_arr[ intval( $conn ) ] = $event; 这里的event_arr 感觉完全没有应到到其他地方 只是将event保存了到数组并没有对数组进行操作
14. PHP [socket初探
// 这里值得注意,我们声明两个数组用来保存 事件 和 连接socket $event_arr = []; $conn_arr = []; // 此处值得注意,我们需要将事件本身存储到全局数组中,如果不保存,连接会话会丢失,也就是说服务端和客户端将无法保持持久会话 $event_arr[ intval( $conn ) ] = $event;
event_arr
The text was updated successfully, but these errors were encountered:
其实你试一下,如果不保存会这样,就知道了
Sorry, something went wrong.
No branches or pull requests
在 案例
14. PHP [socket初探
中](https://github.com/elarity/advanced-php/blob/master/14.%20PHP%20socket%E5%88%9D%E6%8E%A2%20---%20%E5%90%AB%E7%9D%80%E6%B3%AA%E4%B9%9F%E8%A6%81%E7%A3%95%E5%AE%8Clibevent%EF%BC%88%E4%B8%89%EF%BC%89.md)聊天代码里
// 这里值得注意,我们声明两个数组用来保存 事件 和 连接socket $event_arr = []; $conn_arr = []; // 此处值得注意,我们需要将事件本身存储到全局数组中,如果不保存,连接会话会丢失,也就是说服务端和客户端将无法保持持久会话 $event_arr[ intval( $conn ) ] = $event;
这里的
event_arr
感觉完全没有应到到其他地方 只是将event保存了到数组并没有对数组进行操作The text was updated successfully, but these errors were encountered: