I need to change the user agent on mobile. I tried with pure php but it did not work, I'm using Mobile Detect, until I can detect when it's mobile, but I can not change the user agent.
The example I followed was this
if(!$detect->isMobile()) {
$userAgent = 'BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103';
$detect->setUserAgent($userAgent);
echo $_SERVER['HTTP_USER_AGENT'] . "<hr />\n";
}
What's wrong?