donatj / PhpUserAgent

Lightning Fast, Minimalist PHP User Agent String Parser.
https://donatstudios.com/PHP-Parser-HTTP_USER_AGENT
MIT License
565 stars 128 forks source link

Add user_agent initial string to output #55

Closed sunnybear closed 5 years ago

sunnybear commented 5 years ago

Please add user_agent key (with initial u_agent variable value) to return. It's usefull to operate with the whole object - initial string, platform, browser, version - to insert into DB rather than with 2 different variables, initial ua and user_agent array.

donatj commented 5 years ago

Assuming you are asking for the full original string as passed by the browser, can you not just read it from $_SERVER['HTTP_USER_AGENT'] yourself?

sunnybear commented 5 years ago

Ok, good luck. It's quite convenient to have one array with all values instead of merging several arrays together. But as you wish.