Basic function usage help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JesseJ
Forum Newbie
Posts: 1
Joined: Thu Jun 10, 2010 11:01 pm

Basic function usage help

Post 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 :)
Post Reply