PHP5.2.6 无符号长整形的位运算?

WBOY
Release: 2016-06-13 13:29:11
Original
860 people have browsed it

求助 PHP5.2.6 无符号长整形的位运算??
RT!

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
$v=time();
$para=(int)5566778899;
$v=$v^$para;
echo "time: ".$v."<br>";

Copy after login


描述:我是想获得距格林尼子时间的秒数,然后和一个数(eg:5566778899)异或位运算。但是返回的是一个负数,看网上的资料都是和ip地址挂钩的。

如果要实现我的这个功能,应该怎么做呀??不胜感激!

------解决方案--------------------
$v=$v^$para ^ -1;
------解决方案--------------------
gmp_xor
------解决方案--------------------
这样
PHP code
echo sprintf("%u",-639610008); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template