fork download
  1. <?php
  2. $a=[2,7,14,28,32,38,41,49];
  3. $b=30;
  4. $cc=0;
  5. while(1){
  6. if( floor($a[$cc]) && floor($a[$cc+1]) ){
  7. if( floor($a[$cc]) < $b && $b < floor($a[$cc+1]) ){
  8. echo '找到('.$a[$cc].'-'.$a[$cc+1].')' ;
  9. }
  10. }else{echo '結束';break;}
  11. $cc=$cc+1;
  12. }
Success #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
找到(28-32)結束
stderr
PHP Notice:  Undefined offset: 8 in /home/9PvYtu/prog.php on line 6