[function-Variable] - Tea Bag Dipping tecnology

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

[function-Variable] - Tea Bag Dipping tecnology

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

do what task?
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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
Post Reply