-1

I am working on a PHP application, the mobile app requests to PHP app for some service. The mobile app is sending a device token to server. So I want to find out what mobile OS the request is coming from? It's android or iPhone?

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Deepti Kakade
  • 3,053
  • 3
  • 19
  • 30

1 Answers1

2

If you need only separate android and iphone, add to request parameter &os=android in android's code and &os=iphone in iPhone's code.

Add: Also you can used the $_SERVER[ 'HTTP_USER_AGENT'].

Arslan Ali
  • 17,418
  • 8
  • 58
  • 76
Tapa Save
  • 4,769
  • 5
  • 32
  • 54