Advertisement
mendigo

Untitled

Aug 12th, 2011
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. function __construct($classe)
  2. {
  3.     $diretorios = array('class', 'interface');
  4.  
  5.     foreach ( $diretorios as $diretorio ) {
  6.  
  7.         if ( file_exists($diretorio . '/' . $classe . '.php') ) {
  8.             require $diretorio . '/' . $classe . '.php';
  9.             break;
  10.         }
  11.     }
  12.  
  13. }
  14.  
  15.  
  16. $cliente = new Cliente();
  17.  
  18. $pessoa = new Pessoa();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement