title: How to convert dot notation to object in php?
body: <p>I need a function that give an instance and a dot notation string and return its equivalent object. Something like this</p>
  
  <pre><code>public function convert($instance , $str) {
      //If $str = 'instance' return $instance
      //If $str = 'instance.name' return $instance-&gt;name
      //If $str = 'instance.member.id' return $instance-&gt;member-&gt;id
      //...
  }
  </code></pre>
  
  <p>How can I do this</p>