In PHP you can use an associative array:
someFunction(array( "a" => 3243, "b" => 2354, "c" => 33453, "d" => 324353, "e" => 321243, "f" => 321243, "g" => 312243, "h" => 321243, ))
Or properties of the object on which the function is called (if that makes sense). PHPMailer sends emails as follows:
// instantiate the class $mailer = new PHPMailer(); // Set the subject $mailer->Subject = 'This is a test'; // Body $mailer->Body = 'This is a test of my mail system!'; // Add an address to send to. $mailer->AddAddress(' foo@host.com ', 'Eric Rosebrock'); if(!$mailer->Send()) { echo 'There was a problem sending this mail!'; }
And he has many more additional parameters. It can also use a method with 100 parameters, but it is much more readable.
EDIT: These solutions also better support advanced options. In the case of properties, this is simple; in the case of an associative array, you can combine the array with an array of default values.
source share