Skip to content

Instantly share code, notes, and snippets.

@lyndell
Last active April 19, 2016 03:08
Show Gist options
  • Save lyndell/04b5b4e6f398be58c9d69cc905166224 to your computer and use it in GitHub Desktop.
Save lyndell/04b5b4e6f398be58c9d69cc905166224 to your computer and use it in GitHub Desktop.
print the useragent string and split it by slashes
<?php
header('Content-Type: text/plain');
$browser = $_SERVER['HTTP_USER_AGENT'];
echo $browser . "\n\n";
$browserArray = split('/', $browser);
print_r($browserArray) . "\n\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment