时间:2021-07-01 10:21:17 帮助过:16人阅读
$a = base_convert(85,10,4); //85为数字等级
$b = array(1=>'star',2=>'moon',3=>'sun',4=>'crown');
$e = strlen($a);
for($i=0;$i<$e;$i++){
$c = (int)substr($a,$i,1);
if($c>0) for($d=0;$d<$c;$d++) echo '';
}
if(isset($_GET['img'])) {
die(file_get_contents("http://id.qq.com/level/img/$_GET[img].png"));
}
$a = base_convert(85,10,4); //85为数字等级
$b = array(1=>'star',2=>'moon',3=>'sun',4=>'crown');
$e = strlen($a);
for($i=0;$i<$e;$i++){
$c = (int)substr($a,$i,1);
if($c>0) for($d=0;$d<$c;$d++) echo '';
}
function qqdj($nowlevel)
{
/*星星1 月亮4 太阳16 皇冠64 */
$a = $b = $c = $d = 0;
$d = floor($nowlevel/64);
$dj= $nowlevel%64;
$c = floor($dj/16);
$dj = $dj%16;
$b = floor($dj/4);
$a = $dj%4;
return array($a,$b,$c,$d);
}
function qqdjImg($nowlevel)
{
/*星星1 月亮4 太阳16 皇冠64 */
$arrDJ = array();
$arrDJ[] = floor($nowlevel/64);
$dj= $nowlevel%64;
$arrDJ[] = floor($dj/16);
$dj = $dj%16;
$arrDJ[] = floor($dj/4);
$arrDJ[] = $dj%4;
$arrImg = array(
'',
'',
'',
'',
);
$html = '';
foreach ($arrDJ as $k => $v)
{
$html .= str_repeat($arrImg[$k],$v);
}
print_r($arrDJ);
return $html;
}
$dj = 37;
$dj = 71;
echo qqdjImg($dj);
/*
X-Powered-By: PHP/5.2.0
Content-type: text/html
Array
(
[0] => 1
[1] => 0
[2] => 1
[3] => 3
)