function question

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
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

function question

Post by Charles256 »

erm..how would I go back out declaring a function when I don't know how many parameters there would be? Might be 10 variables passed to it, might be ten million. Any clues? Links? Slaps?anything?:)
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Last edited by Jenk on Fri Sep 30, 2005 8:25 pm, edited 1 time in total.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

but if i don't declare a variable when defining the function how do I refer to it within the function? i.e.

Code: Select all

function ()
{
}
function (1,2,3)
how would i reference that within the function?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Have you read the link?

Check out the quicklinks on it to func_get_arg() and func_get_args()

:)
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

i read the link but in my haste read over the important part. it be stored in an array. rather tedius but i think i can work it out just write that it works properly. it's tricky becausei plan on sending something like
1,2,3,4,5,6,7,8;1,2,3,4,5,6,7,8;1,2,3,4,5,6,7,8 and so on and so forth:-D shall be tricky.lol
Post Reply