How to detect a mobile browser using PHP in content? Using Drupal 7.14 with the PHP filter on I have the following in a Basic Page content type:

&lt;?php if ($is_mobile == TRUE):?&gt;
&lt;div class="fb-like-box" data-href="http://www.facebook.com/a page" data-width="710" data-height="600" data-show-faces="false" data-border-color="#73AA4B" data-stream="true" data-header="false"&gt;&lt;/div&gt;
&lt;?php else: ?&gt;
&lt;div class="fb-like-box" data-href="http://www.facebook.com/a page" data-width="900" data-height="600" data-show-faces="false" data-border-color="#73AA4B" data-stream="true" data-header="false"&gt;&lt;/div&gt;
&lt;?php endif; ?&gt;


I get the error message:

Notice: Undefined variable: is_mobile in eval() (line 1 of D:\websites\modules\php\php.module(80) : eval()'d code).

I sort of understand - I'm trying to grab a variable from the Drupal system but is there any way to do this? Maybe using Tokens?
Mobile detection isn't built into Drupal or most popular themes (I think Adaptive Theme does, though).  You need to install a contrib module to do this.  Three options are Browscap, Mobile Tools, and Mobile Detect.  Where you go from here depends on which module you are using.