So Here's My Code. It Works When I Use Longer If Statement, But Not When I Use Shorthand. Sorry For My Bad English.
<?php
function __autoload($class) {
$path = "includes/{$class}.php";
// IT WORKS LIKE THIS
if (file_exists($path)) {
require_once($path);
}
else {
die("File Not Found :(");
}
//But Not Like This
require_once() file_exists($path) ? $path : die("File Not Found :(");
}
?>
Aucun commentaire:
Enregistrer un commentaire