date_default_timezone_set('Africa/Lagos');
function generateRandom($length = 24)
{
return bin2hex(openssl_random_pseudo_bytes($length));
}
$value = "5000";
$now = new DateTime("now");
$rid = generateRandom();
$current_timestamp = strtotime("now");
$timestamp = "×tamp";
$valueToHash = "rid='$rid'&value='$value'×tamp=".$now->getTimestamp();
echo $valueToHash;
die;
When i am echoing $valueToHash output is -
rid='1f7cde02bd050f17e29a4c0f42e55bae96e4543a87133921'&value='5000'×tamp=1530082495
but output should be like-
rid='1f7cde02bd050f17e29a4c0f42e55bae96e4543a87133921'&value='5000'×tamp=1530082495
Need help in this..
I guess you're outputting raw text on an html page.
The result is that, at a certain point, you're printing ×tamp
, which actually contains an HTML entity (×
) which, guess what, gets interpreted and output as ×
.
If you don't need to actually display this but only use it inside, say, the href
attribute of an a
element, you can disregard the problem and leave it as it is.