开发者

How can I concatenate these values and perform an md5 calculation

开发者 https://www.devze.com 2023-01-03 04:50 出处:网络
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);

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

精彩评论

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