title: PHP: Calling another class' method
body: <p>I'm still learning OOP so this might not even be possible (although I would be surprised if so), I need some help calling another classes method.</p>
  
  <p>For example in <code>ClassA I</code> have this method:</p>
  
  <pre><code>function getName()
  {
      return $this-&gt;name;
  }
  </code></pre>
  
  <p>now from <code>ClassB</code> (different file, but in the same directory), I want to call <code>ClassA</code>'s <code>getName()</code>, how do I do that? I tried to just do an <code>include()</code> but that does not work.</p>
  
  <p>Thanks!</p>