首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
V2EX
›
PHP
麻烦解答一下 php 下用 md5 生成的 hash ,这个参数里面的句号是什么作用 .代码内详
GPU
·
2014-05-25 20:07:09 +08:00
· 2998 次点击
这是一个创建于 3787 天前的主题,其中的信息可能已经有所发展或是发生改变。
https://gist.github.com/p0w3r-/14b3e07f3772cba62171.js
代码就是 。这个小数点起什么作用的?
小数点
代码
参数
5 条回复
•
2014-05-25 20:28:26 +08:00
1
Sunyanzi
2014-05-25 20:13:05 +08:00
点儿是字符串连接符 ... $id 存在的作用是一个 dynamic salt ...
参考
http://php.net/manual/en/language.operators.string.php
...
也就是 md5($passwd.$id) == md5( 'power11111' ) 而不是 power.11111 ...
2
GPU
OP
2014-05-25 20:14:52 +08:00
@
Sunyanzi
php 是没有 “ + ” 这个连接符?
3
GPU
OP
2014-05-25 20:17:20 +08:00
https://gist.github.com/14b3e07f3772cba62171
4
Sunyanzi
2014-05-25 20:20:39 +08:00
@
GPU
「.」用于拼接两个字符串 ... 在「.」两侧的内容会自动被转化为字符串 ...
「+」用于将两个数值型变量相加 ... 在「+」两侧的内容会自动被转化为数值型 ...
an example for you ...
123.456 // 123.456
123 . 456 // 123456
'123' + '456' // 579
'123' + 456 // 579
123 + '45.6' // 168.6
5
GPU
OP
2014-05-25 20:28:26 +08:00
@
Sunyanzi
好吧 , 明白是什么意思了。 谢谢!
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
810 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms ·
UTC 22:50
·
PVG 06:50
·
LAX 15:50
·
JFK 18:50
Developed with
CodeLauncher
♥ Do have faith in what you're doing.