为什么md5('240610708')等于md5('QNKCDZO')? [英] Why md5('240610708') is equal to md5('QNKCDZO')?
本文介绍了为什么md5('240610708')等于md5('QNKCDZO')?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var_dump(md5('240610708') == md5('QNKCDZO'));
输出:
bool(true)
推荐答案
md5('240610708')
的结果是0e462097431906509019562988736854
.
md5('QNKCDZO')
的结果是0e830400451993494058024219903391
.
它们都是浮点数格式字符串(数字字符串),如果您在php中使用==
,则在将数字与字符串进行比较或比较涉及数字字符串,然后将每个字符串转换为数字,然后以数字方式进行比较.
They are both float number format strings (numerical strings), and if you use ==
in php, when compare a number with a string or the comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically.
与==
相比,这两个字符串都转换为0
,如果要将它们作为字符串进行比较,请记住改用===
(严格比较).
Both of the strings are converted to 0
when compared with ==
, if you want to compare them as string, remember to use ===
(strict comparison) instead.
请参阅: PHP表示两个不同的字符串保持一致
这篇关于为什么md5('240610708')等于md5('QNKCDZO')?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文