Jump to content


This topic is now archived and is closed to further replies.


Help setting object vars

Recommended Posts

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"


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.