如何将各种类型参数的数组转换为函数中的实际参数?
$params = array( 'the title2', 'the footer2', 10);
displayTest(implode(',', $params)); //how???
displayTest(convert_to_parameters($params)); //how???
function displayTest($title, $footer, $numberOfItems = 0) {
$r = '';
$r .= '<div>'.$title.'</div>';
for($index = 0; $index < $numberOfItems; $index++) {
$r .= '<div>the text</div>';
}
$r .= '<div>'.$footer.'</div>';
return $r;
}