How I use a class inside another in PHP?
<p>I have two classes. UserModel and UserController.</p>

<p>file: localhost/controllers/user.controller.php</p>

<pre><code>&lt;?php
class UserController
{
    public function GetArray() {
        $query = 'SELECT id, username, email, password FROM Users';
        $result = mysql_query($query);
        $model = new UserModel();
        while ($row = mysql_fetch_array($result)) {
            $model-&gt;id = $row['id'];
            $model-&gt;username = $row['username'];
            $model-&gt;email = $row['email'];
            $model-&gt;password = $row['password'];
            $array[] = $model;
        }
        return $array;
    }
}
?&gt;
</code></pre>

<p>The UserModel class is in another file: localhost/models/user.model.php. The 6th row is causing the error, because there's no references to the other file. How can I do that?</p>

<p>Sorry for my bad english, and thanks to you all.</p>
