$_SERVER['HTTP_USER_AGENT']
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Simple mobile/desktop detection example:
<?php
$get_user_agent = $_SERVER['HTTP_USER_AGENT'];
if (preg_match('/android|mobile|tablet|ip(od|hone)/i', $get_user_agent)) { echo 'Mobile'; } else { echo 'Desktop'; }
?>
Result: Desktop