Pass your parameter as an array rather than a variable. Then you 
traverse the array to get all your values.

On Friday, July 26, 2002, at 09:38 PM, Mathieu Dumoulin wrote:

> Ok, here i made a function that can accept an unknown number of params.
> In fact, it's a data interface for a mysql database, when i call the
> object's constructor it is in possibility to pass any number of table 
> names
> from 1 to x. Now i got this other class called a data interfacer which 
> sends
> a certain number of tables to the data interface constructor. I tried 
> doing:
> $interface = new data_interface($table1, eval("$table2, $table3, 
> $table4"));
> $interface = eval("new data_interface($table1, $table2, $table3, 
> $table4)");
> and various other tries. The thing is i can't know how many tables can 
> be
> transfered from the data interfacer to the data_interface. So i could 
> make a
> if..elseif...elseif until i reach something like 10 tables but still, 
> it's
> not a good practice, i'm sure there is a way to emulate real parameters 
> when
> they are needed and skip them in the call if you don't have them.
> Can anybody help me out?
> InsaneCoder
> --
> PHP General Mailing List (
> To unsubscribe, visit:
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to