Im new to OOP in PHP. I just can't extend a class from an external file. They are both on the same folder.
DB.php
<?php
class DB {
// some functions here
}
Home.php
<?php
require_once("DB.php");
class Home extends DB {
// initialize db and some functions here
}
and I get an error: Fatal error: Class 'DB' not found in \location\to\Home.php on line 3
requirethe file first.requirewith absolute path.require_once __DIR__ . '/DB.php';