Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
backend
php
oop
namespaces
full_example
inc
spl_autoload_exception.inc.php
spl_autoload_exception.inc.php
<?php class LoadLib{ public static function libra($class) { $filename=strtolower($class).'.class.php'; $filename=str_replace('\\','/',$filename); $put='./'.$filename; if(is_readable($put)){ include $put; echo "<br/>Ucitan: <b>$put</b><br/>"; } else{ throw new \Exception("Ne moze se ucitati <b>$put</b> ili taj fajl ne postoji."); } } } $lib1_put='LoadLib::libra'; spl_autoload_register($lib1_put); ?>
Reload page
Preview
W3C validation
Edit Code