function get_area($mob){
$mob=substr($mob,0,7);
if(
$handle=@fopen('mob.dat','rb'))
{
@flock($handle,LOCK_SH);
$string=@fread($handle,@filesize('mob.dat'));
@fclose($handle);
}
$string=strstr($string,$mob);
$num=strpos($string,"n");
$end=substr($string,0,$num);
list($a,$area)=explode(",",$end);
return $area;
} //demo
echo get_area('13000000000');
|