title: PHP custom class loader
body: <p>i made a custom class loader function in php
  something like..</p>
  
  <pre><code>load_class($className,$parameters,$instantiate);
  </code></pre>
  
  <p>its supposed to include the class and optionally instantiate the class specified</p>
  
  <p>the problem is about the parameters. ive been trying to pass the parameters all day
  i tried</p>
  
  <pre><code>load_class('className',"'param1','param2'",TRUE);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>load_class('className',array('param1','param2'),TRUE);
  </code></pre>
  
  <p>luckily nothing works xD
  is it possible to pass the params?
  i even tried..</p>
  
  <pre><code>$clas = new MyClass(array('param1','param2'));
  </code></pre>
  
  <p>here it is..</p>
  
  <pre><code>function load_class($class, $param=null, $instantiate=FALSE){
      $object = array();
      $object['is_required'] = require_once(CLASSES.$class.'.php');
      if($instantiate AND $object['is_required']){
          $object[$class] = new $class($param);
      }
      return $object;
  }
  </code></pre>