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));
精彩评论