Sending variables between 2 functions

#4
[eluser]webthink[/eluser]
Since you asked about sending a variable between functions you should probably see this example as well (not everything should be set as a class attribute)
Code:
class Someclass
{

   function a()
   {
      $foo = 1
      $foo2 = $this->b($foo);
   }

   function b($foo)
   {
      if(is_numeric($foo))
      {
          return $foo + 1;
      }
      else
      {
          return 10;
      }
   }
}


Messages In This Thread
Sending variables between 2 functions - by El Forum - 04-03-2008, 02:53 AM
Sending variables between 2 functions - by El Forum - 04-03-2008, 03:18 AM
Sending variables between 2 functions - by El Forum - 04-03-2008, 03:58 AM
Sending variables between 2 functions - by El Forum - 04-03-2008, 04:08 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.