头像

php判断字符串在某个区间,并查询出对应区间的值

2020-04-04 15:26:25 浏览()   来源:http://www.phpdaima.com//jsfx-91.html   评论 ( 0 )   

php判断字符串在某个区间,并查询出对应区间的值

<?php
$ranks = array(1900=>'32',1800=>'31',1700=>'30',1600=>'29',1500=>'28',1400=>'27',1300=>'26',1400=>'25',1100=>'24',1000=>'23',900 =>'22',800 =>'21',700 =>'20',600 =>'19',500 =>'18',400 =>'17',300 =>'16',200 =>'15',100 =>'14',0=>'13');
$rank_point = 1880;
$rank_name = null;
foreach($ranks as $check_rank_point=>$check_rank_name){
    $rank_name = $check_rank_name;
    if($rank_point > $check_rank_point)break;
}
echo $rank_name;
?>

如有问题,请联系我,谢谢1

标签:
广告不存在
评论0

后面还有条评论,点击查看>>

温馨提示:为规范评论内容,垃圾评论一律封号...