当我通过负值时,我收到此错误latitude
。longitude
当我通过正值时它可以正常工作。需要一个解决方案。
错误:
1.Warning: array_intersect(): Argument #2 is not an array in C:\wamp\www\#\#.php on line 41
2.Warning: array_keys() expects parameter 1 to be array, null given in C:\wamp\www\#\#.php on line 42
$aaa=0;
$e=0;
$s=0;
$query1=mysql_query("select * from user_details where username!='$a' and availablestatus='1' and status='1'");
while($row=mysql_fetch_array($query1))
{
$q[$e++]=$row['id'];
$m=$row['username'];
$k=$row['latitude'];
$l=$row['longitude'];
$aa[$aaa++]=1609.344 * 60 * 1.1515 * (180 / pi()) * acos(sin($i * pi() / 180) * sin($k * pi() / 180) + cos($i * pi() / 180) * cos($k * pi() / 180) * cos(($j - $l) * pi() / 180));
}
$res=array_combine($q,$aa);
foreach($res as $val)
{
if($val>='0' && $val<='10000')
{
$ah[$s++]=$val;
}
}
$rs=array_intersect($res,$ah);
$rs1=array_keys($rs);