1
votes

I Have this user agent :

User Agent : Mozilla/5.0 (Linux; Android 7.1.2; Redmi 4A Build/N2G47H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.158 Mobile Safari/537.36 FreeDDNS-APP

Now, how to just show "FreeDDNS-APP" with php ?

1
What have you tried so far? What worked and what didn't? Please update your question to avoid downvoted. There are many ways to do it, including pretty much standard PHP browscap, as well as various opensource libraries. There's always good ol'friend regex if you feel brave enough. – Michal
Thank you @KhoaTruongDinh ! I Solved This Problem – Muhammad Rifky

1 Answers

2
votes

For the basic logic, we can try with http://php.net/manual/en/function.get-browser.php#101125. We use $_SERVER['HTTP_USER_AGENT'] for analyzing the User Agent.

There are some useful libs here:

https://github.com/zsxsoft/php-useragent

https://github.com/WhichBrowser/Parser-PHP