开发者

How can I concatenate these values and perform an md5 calculation

I have some values:

$data1
$data2
$data3

I want to concatenate these variables and then perform an md5 calculation h开发者_运维问答ow is it done??


echo md5($data1.$data2.$data3);

Related:

  • PHP Manual on md5()
  • PHP Manual on Strings


md5($data1 . $data2 . $data3);


If your values are strings it's pretty easy

md5($data1 . $data2 . $data3);

If they are not string you need to first convert them.


If your vars are no simple strings, but maybe objects or arrays you could go like this:

md5(serialize($data1 . $data2 . $data3));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜