title: PHP evaluate class sub member
body: <pre><code>class Customer{
      public $country;
      public function __construct(){
        $this-&gt;country = new Country();
        $this-&gt;country-&gt;name = "USA";
     }
  
  }
  
  class Country{
  
  }
  </code></pre>
  
  <p>I want to print the country name, but i have the following context only.</p>
  
  <pre><code> $c = new Customer();
   $member = "country.name";// i cant decide on this, this is what i get as a parameter
  </code></pre>
  
  <p>Can you please suggest how I can print the country name with the provided country.name string?</p>
  
  <p>The solution im building here is for email template</p>
  
  <p><code>"the country that good for you is {country.name}"</code></p>
  
  <p>So I will replace country.name to USA with the help of <code>$c</code> and <code>$member</code></p>