Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9074817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:43:29+00:00 2026-06-16T18:43:29+00:00

When I pass latitude and longitude in negative value I am receiving this error.

  • 0

When I pass latitude and longitude in negative value I am receiving this error. It works right when I passed positive value. Need a solution for it.

Error:

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);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:43:30+00:00Added an answer on June 16, 2026 at 6:43 pm

    The problem is if($val>='0' && $val<='10000') is only allowing for positive values.

    If this is intended behaviour then define $ah=array(); before foreach($res as $val)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing JSF geolocation service where I need to pass latitude and longitude
I have this data... 45°25'02.98 10°11'30.39, how can retrive Latitude and Longitude to pass
I have a CTE based query into which I pass about 2600 4-tuple latitude/longitude
I have a CTE based query, to which I pass about 2600 4-tuple latitude/longitude
I am brand new to MVC. I am trying to pass longitude and latitude
I am trying to pass two variables (latitude and longitude) to the google.maps.StreetViewPanorama method
Need to post status update and attach user location by passing latitude and longitude.
<?php in this part I provide a latitude a longitude to reverse geocode. $ch
I am trying to pass latitude and longitude to another activity and check the
I want to pass an ImageIcon instance by value as we know that by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.