PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $values = [ "id"=>17105, "reference"=>"ref_12344", "amount"=>10.00, "additionalinfo"=>"A test ticket transaction", "returnurl"=>"http://www.google.com/search?q=returnurl", "resulturl"=>"http://www.google.com/search?q=resulturl", "status"=>"Message" ]; $IntegrationKey = '3e9fed89-60e1-4ce5-ab6e-6b1eb2d4f977'; // Call the function to generate the hash $hashed = CreateHash($values, $IntegrationKey); function CreateHash($values, $IntegrationKey) { $string = ""; foreach($values as $key=>$value) { if( strtoupper($key) != "HASH" ){ $string .= $value; } } $string .= $IntegrationKey; $hash = hash("sha512", $string); return strtoupper($hash); } echo $hashed; ?>
Show:  
Copy Clear