Best way to pass values to a function when there are many to send?
问题 What is the best way to define a method signature when you have to pass many values to a function and some of these may be optional. And in future, May be I have to pass more variables or subtract some passed values given to function. For example: (phone and address are optional) function addInfo( $name, $dob, $phone='', $address='' ) { // Store data } addInfo( 'username', '01-01-2000', '1111111' ); // address is not given OR function addInfo( $info ) { // Store data } $info = array( 'name'=>