Use commas to separate the arguments:
<?php
function do_something($args) {
for ($i = 0; $i < count($args); $i++) {
// Assign $arg1 with first argument, $arg2 with second, etc.
${arg . ($i + 1)} = $args[$i];
}
}
?>
Or you could separate the arguments by commas and do this:
<?php
function do_something($args) {
$args = explode(',', $args);
for ($i = 0; $i < count($args); $i++) {
// Assign $arg1 with first argument, $arg2 with second, etc.
${arg . ($i + 1)} = $args[$i];
}
}
?>