Question: I want to get the current location in longitude and latitude in Android 8.0+ when the app is running and I don't want to display notification as we have in the background services. 

I was previously using background location services in android below 8.0 but in 8.0 we need to show a notification.

Answer: 
```
    if($count > 0)
    {   
        $phone ='';
        while($row = $get_result->fetch_assoc())
        {
            if($phone==''){
                $phone .=$row['dnr_phone']; 
            }else{
                $phone .=','.$row['dnr_phone']; 
            }
            echo $phone;
        } 
        sendSMS("Pname",$phone,$message);
    }

```
Due to above code, $phone takes only last mobile number,because sendSMS function called after while loop.

Solution::
sendSMS("Pname",$phone,$message);
This function should be in while loop.