Xu Wei Jie Posted March 13, 2009 Share Posted March 13, 2009 Hi all, I wish to parse in an array of arrays into a function. How do i do that? function pass(variable argument of arrays) { //how do I loop through the arrays retrieving its keys and values? } Thanks Link to comment https://forums.phpfreaks.com/topic/149212-array-of-arrays/ Share on other sites More sharing options...
Xu Wei Jie Posted March 13, 2009 Author Share Posted March 13, 2009 Or how could I pass in a variable number of arguments into a function? Link to comment https://forums.phpfreaks.com/topic/149212-array-of-arrays/#findComment-783575 Share on other sites More sharing options...
ratcateme Posted March 13, 2009 Share Posted March 13, 2009 have a look at func_get_arg and func_get_args they should help you Scott. Link to comment https://forums.phpfreaks.com/topic/149212-array-of-arrays/#findComment-783577 Share on other sites More sharing options...
kickstart Posted March 13, 2009 Share Posted March 13, 2009 Hi You can take a load of parameters to a function, and just set each to have a default value:- function fred ($parm1 = "some default value", $parm2= "another default value", etc). OK if you have a few possible parameters but useles if you have an effectively infinite number of them. If you want to pass an array then just have a single parameter in the function declare . That will just have the array (or array of arrays) assigned to it. All the best Keith Link to comment https://forums.phpfreaks.com/topic/149212-array-of-arrays/#findComment-783602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.