Page 1 of 1

Basic function usage help

Posted: Thu Jun 10, 2010 11:08 pm
by JesseJ
Hi guys... I'm new to anything beyond basic variables in PHP and just getting my hands dirty now. (I'm a CSS / UI guy). Anyhow, I'm trying to use a function regarding mobile brower dection that looks like this [excerpt]:

Code: Select all

function DetectTierIphone()
   {
      if ($this->DetectIphoneOrIpod() == $this->true) 
         return $this->true; 
      if ($this->DetectAndroid() == $this->true) 
         return $this->true; 
      if ($this->DetectAndroidWebKit() == $this->true) 
         return $this->true; 
      if ($this->DetectPalmWebOS() == $this->true) 
         return $this->true; 
      if ($this->DetectGarminNuvifone() == $this->true) 
         return $this->true; 
      if ($this->DetectMaemoTablet() == $this->true)
         return $this->true;
      else
         return $this->false; 
   }
Full code here if your interested.

And I need to know how to turn that into something easy to use like $iphone=1 so I can use a short conditional around the site to show alternative css / js files etc.

Thanks guys :)