Hey ho ppl.
I need to send a variable amount of variables into a class instantiation.
I am using a head script when I generate the hmtl code, and inside the standard head.php script i always instantiate a class.
sometimes, I only need to send one variable, other times I need to send several vars.
I was trying to put the vars in an array, and loop through the array using the sprintf function to print the vars.
- but that didn`t work.
// $vars is the array
$numbers = count($value) ;
// $content is the name of the class
// which varies
new $content(
for ($idx = 0;$idx < $numbers;++$idx) {
if ($idx < $numbers) {
sprintf("%", $value[$idx],) ;
} else {
sprintf("%", $value[$idx]) ;
} // end if/else
} // End for
When I try to run this, I get a parse error.
eh.. but I can`t find the error.
Anyway. Is this the best way to go about this problem????
Any thoughts on this is warmly welcome!!!!