How would I skip optional arguments in a function call?
问题 OK I totally forgot how to skip arguments in PHP. Lets say I have: function getData($name, $limit = \'50\', $page = \'1\') { ... } How would I call this function so that the middle parameter takes the default value (ie. \'50\')? getData(\'some name\', \'\', \'23\'); Would the above be correct? I can\'t seem to get this to work. 回答1: Your post is correct. Unfortunately, if you need to use an optional parameter at the very end of the parameter list, you have to specify everything up until that