醉梦半醒的博客

进制比较 vs 起名字真难

字数统计: 116阅读时长: 1 min
2018/07/07 Share

<?php
function noother_says_correct($number)
{
$one = ord('1');
$nine = ord('9');
for ($i = 0; $i < strlen($number); $i++)
{
$digit = ord($number{$i});
if ( ($digit >= $one) && ($digit <= $nine) )
{
return false;
}
}
return $number == '54975581388';
}
$flag='*******';
if(noother_says_correct($_GET['key']))
echo $flag;
else
echo 'access denied';
?>

要使$number == ‘54975581388’

但是不能每一位是数字

<?php
if (“54975581388″==”0xccccccccc”){
echo “ok”;
}
else{
echo “no”;
}

?>

测试下进制比较的结果,转化为十六进制即可通过

例题http://chinalover.sinaapp.com/web12/index.php

CATALOG