Detailed explanation of PHP mobile phone location query function_PHP tutorial

WBOY
Release: 2016-07-13 10:48:52
Original
1148 people have browsed it

This article will introduce to you a PHP mobile phone location query function written by myself. The principle is very simple and the implementation is not difficult. I believe everyone can understand it.

if( $handle=@fopen('mob.dat','rb'))
The code is as follows
 代码如下 复制代码


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');

Copy code


function get_area($mob){

$mob=substr($mob,0,7);
{ @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');
Home data file download: mob.dat
http://l4.yunpan.cn/lk/QvYCBFP6TVBjy http://www.bkjia.com/PHPjc/632764.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632764.htmlTechArticleThis article will introduce to you a self-written PHP mobile phone location query function. The principle is very simple and the implementation is easy. It’s not difficult, I believe everyone can understand it. The code is as follows Copy code function...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!