Page 1 of 1

[function-Variable] - Tea Bag Dipping tecnology

Posted: Mon Dec 27, 2004 8:32 am
by harsha
Hi
All :wink:

Please help me solve this problem

I have a class in that there is a function in it

and I am passing a (optional) argument to that function by reference

some thing like this function name(arg1, &arg2);

and each time the argument passed to that function is different variables reference.

How do I do this task.

Posted: Mon Dec 27, 2004 9:25 am
by feyd
do what task?

Posted: Mon Dec 27, 2004 9:48 pm
by harsha
it is like the function fetches the data from the database array and it put it in the multidimensional array. and refrence that I have passed to function is that multidimensional array. and each time i don;t pass the same reference.

ie., function($dbQuery, &$News);
function($dbQuery, &$Article);

how to achieve this.

Posted: Mon Dec 27, 2004 10:20 pm
by feyd
okay, so you have arbitrary multidimensional arrays that you'd like to pass to a general function. Would this function need to know how to fill each kind of array, or would it fill them the same way each time?

if each kind of array is filled differently, then you probably need to have some other helper functions, classes, methods to create a simple interface this function uses. If you don't, you'll probably have lots of spagetti code.

If they are filled the same, then it doesn't really matter what the array is.. :P