<?php
//php7+
define('CONFIG', [
'MYSQL' => '127.0.0.1',
'REDIS' => '127.0.0.2'
]);
echo CONFIG['REDIS'];简单好用,需要php7才能支持,世界上最好的编程语言,哈哈
md5/sha1+salt方式是目前各大cms常用的加密方式,虽然salt安全,但是各大md5网站也在研究这个方向,那么我们应该选择password_hash动态hash来助力,一种密码有多种hash结果.看代码模拟登陆.<?php //01.注册 $user ='zhang...
<?php /** * @throws Exception */ function curl() { throw new \Exception('err...
php event扩展在windows中依赖于php_sockets扩展,因此在php.ini中必须先加载php sockets扩展,如下。extension=sockets extension=event...
场景:模拟验证码发送。仅做代码演示。(1).创建一个验证码发送接口sendCaptcha/** * 发送验证码 */ public function sendCaptcha() { //外部参数(获...
编写socket服务检测是否有新连接加入都要使用stream_socket_accept和socket_accept来获取,但是默认是阻塞的,想要更换为非阻塞并不能用stream_set_blocking($socket, false),因为stream_set_blocking只是设置socket...
socket_import_stream函数可以将使用stream_socket_server创建stream socket句柄转换为标准的socket句柄,因为标准socket支持更多的配置选项。在workerman中有如下代码:if (function_exists('sock...