Jump to content


Photo

Help setting object vars


  • Please log in to reply
1 reply to this topic

#1 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 14 August 2006 - 12:24 PM

class foo {
  
  public $myvar = array();

  public function setmyvar($key,$val) {
     $this->myvar[$key] = $val;
 }
  
   //need help here 
  public function bar() {
       
   // $somevar[ all keys from $this->myvar ] = "some value";
  // ex:  if this->myvar has 3 keys, 'name','location','age'
  //I need that , $somevar['name']['location']['age'] = "some value" 
  }
 
}
tks



#2 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 15 August 2006 - 01:01 PM

anyone :( ?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users