views:

49

answers:

4

I have some values:

$data1
$data2
$data3

I want to concatenate these variables and then perform an md5 calculation how is it done??

+1  A: 
md5($data1 . $data2 . $data3);
hudolejev
A: 

If your values are strings it's pretty easy

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

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

RaYell
+5  A: 
echo md5($data1.$data2.$data3);

Related:

Pekka
+1  A: 

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

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