-1

I have some values:

$data1
$data2
$data3

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

user342391
  • 7,569
  • 23
  • 66
  • 88

4 Answers4

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

Related:

Gordon
  • 312,688
  • 75
  • 539
  • 559
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
2
md5($data1 . $data2 . $data3);
hudolejev
  • 5,846
  • 4
  • 22
  • 28
1

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
  • 69,610
  • 20
  • 126
  • 152
1

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

md5(serialize($data1 . $data2 . $data3));
faileN
  • 92
  • 1