title: php get variable value from other class file function in a different file
body: <p>I have a class like this</p>
  
  <pre><code>class myClass{
      public function getContent() {
          $products  = 'something';
      }
  }
  </code></pre>
  
  <p>Now there is another file called file.php. In that I have included the class file ike this</p>
  
  <pre><code>include_once(dirname(__FILE__).'/class.php');
  </code></pre>
  
  <p>Now inside file.php I have made my code like this</p>
  
  <pre><code>$test  = new myClass();
  $test-&gt;$products;
  </code></pre>
  
  <p>But it is not getting the variable. So can someone tell me how to get the variable from another class file function? Any help and suggestions will be really appreaciable. Thanks</p>