May 17th, 2013, 09:45 PM
Join Date: May 2013
Time spent in forums: 1 h 11 m 6 sec
Reputation Power: 0
How to filter get_browser output
I'm using get_browser(null, true) to display users browser, OS etc. for logging purposes.
However, I don't want to log the complete get_browser output everytime.
If the output were:
[browser_name_regex] => ^mozilla/5\.0 (windows; .; windows nt 5\.1; .*rv:.*) gecko/.* firefox/0\.9.*$
[browser_name_pattern] => Mozilla/5.0 (Windows; ?; Windows NT 5.1; *rv:*) Gecko/* Firefox/0.9*
[parent] => Firefox 0.9
[platform] => WinXP
[browser] => Firefox
and I want to boil it down to:
I've tried using explode, but I can't get it to work properly.
This is what I tried:
$ex=explode(' ', get_browser(null, true));
echo 'OS: '.$ex.;
How would I go about doing that?