mattgleeson Posted July 31, 2006 Share Posted July 31, 2006 HiNew to the forum, so sorry in advance if this question is supposed to be in another forum.I have created a function containing some parameters and now want to call this function but only pass in some parameters using the the parameter's name. i.e.function someFunction($paramA=NULL, $paramB=NULL, $paramC=NULL){ return NULL;}//in my code somwhere i want to do something along the lines of:$variable = someFunction($paramB=>"value");Is this possible?Cheers Quote Link to comment https://forums.phpfreaks.com/topic/16092-calling-functions-using-parameter-names/ Share on other sites More sharing options...
wildteen88 Posted July 31, 2006 Share Posted July 31, 2006 No I dont think this is possible. However when creating your own functions, you should first start of by listing the parameters for that function and then order those parameters in order of priority. You shouldn't create a function which has sometihng like 10+ parameters, otherwsie the order of prority becomes harder to work out, the max paramters I'd say a function should have is 5. Quote Link to comment https://forums.phpfreaks.com/topic/16092-calling-functions-using-parameter-names/#findComment-66342 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.