How to call method within another class using PHP
<p>I created two php classes separately. those are Student.php and Main.php this is my code.</p>

<p><strong>this is my Student.php</strong> </p>

<pre><code>&lt;?php

class Student {

private $name;
private $age;

function __construct( $name, $age) {
    $this-&gt;name = $name;
    $this-&gt;age = $age;
}

function setName($name){
    $this-&gt;name = $name;
}

function setAge($age){
    $this-&gt;age = $age;
}

function getName() {
    return $this-&gt;name;
}

function getAge() {
    $this-&gt;age;
}

function display1() {
    return "My name is ".$this-&gt;name." and age is ".$this-&gt;age;
}

}

?&gt;
</code></pre>

<p><strong>this is my Main.php</strong></p>

<pre><code>&lt;?php

class Main{

function show() {
    $obj =new Student("mssb", "24");
    echo "Print :".$obj-&gt;display1();
}

}

$ob = new Main();
$ob-&gt;show();

?&gt;
</code></pre>

<p>so my problem is when I call taht show method it gives <strong>Fatal error: Class 'Student' not found</strong> what is the wrong in here. is it necessary to import or something? please help me.</p>
