[英]Getting wrong variable name while echoing query string
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 - 当我呼应$ valueToHash输出是-
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. 我想您是在html页面上输出原始文本。
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 ×
. 结果是,在特定点上,您正在打印
×tamp
,它实际上包含一个HTML实体( ×
),可以猜测是什么,然后将其解释并输出为×
。
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. 如果你不需要实际显示这一点,但只是内部使用它,就是说,
href
的属性a
元素,你可以忽略这个问题,离开它,因为它是。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.