- Joined
- Oct 24, 2003
- Messages
- 11,481
- Reaction score
- 6
PHP:
function &oop($class,$function=NULL,$wert=NULL) {
static $objekt;
$return = NULL;
$class = explode(",",$class);
if (!is_array($wert))
$wert = array($wert);
foreach($class as $load)
if (!isset($objekt[$load])) {
eval ("\$objekt[\$load] = new \$load('".((is_null($function) && !is_null($wert)) ? implode("','",$wert) : '')."');");
global $$load;
$$load = $objekt[$load];
}
if (!is_null($function))
if (!preg_match('%^[-_a-zA-Z]+$%',$function))
trigger_error(010001);
else {
$implode = array();
foreach($wert as $value) {
$implode[] = (is_array($value)) ? 'array(\''.implode('\',\'',$value).'\')' : '\''.$value.'\''; }
eval ("\$return = \$objekt[\$class[0]]->".$function."(".implode(',',$implode).");");
}
return $return;
}
bitte sehr, jetzt kannste vll eher den sinn einer funktion erkennen ^^

//EDIT
ui, in der funktion war eine abfrage ja redundant

Last edited: