如何从PHP检测Android应用程序包?

It is possible to detect Android application from php ? I make a HTTP request from android application to PHP script, can I detect in php application package (ex. com.exampleapp.rew), I need this to do a filter between applications that request to the server.

No, this is not possible. The apps have to send their package names by their own.

You should encrypt the packages names, so other applications can't send self-defined package names.

If someone is still searching for the same queries, then try this:

$package_or_bundle = $_SERVER['HTTP_X_REQUESTED_WITH'] ?? null;
echo $package_or_bundle;