Jump to content

Arbitrary Number of Arguments


1337coder2006

Recommended Posts

Hello, nice site.

I am trying to create a class or a function (if its possible) that can have an unknown number of arguments. I've searched google/various forums and i have found nothing, can anyone point me to a good tutorial on this?

I should probably just keep it simple and pass the arguments as an array, but it would be nice to know how to do this.
Link to comment
https://forums.phpfreaks.com/topic/12925-arbitrary-number-of-arguments/
Share on other sites

[!--quoteo(post=388004:date=Jun 26 2006, 04:21 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 26 2006, 04:21 AM) [snapback]388004[/snapback][/div][div class=\'quotemain\'][!--quotec--]
polymorphism is the keyword you want to use in your search.
[/quote]

i did a search on that but it led me to a tutorial on object overloading, i'll try again, thank you.

Also, I think the solution I'm looking for is just to use func_get_args which will return the function arguments in an array.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.