1

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 ?

3
  • 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. Commented Nov 1, 2018 at 2:47
  • Here is what you need: php.net/manual/en/function.get-browser.php#101125 Commented Nov 1, 2018 at 2:47
  • 1
    Thank you @KhoaTruongDinh ! I Solved This Problem Commented Nov 1, 2018 at 2:58

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.