1function concatenate($transform, ...$strings) {
2 $string = '';
3 foreach($strings as $piece) {
4 $string .= $piece;
5 }
6 return($transform($string));
7}
8
9echo concatenate("strtoupper", "I'd ", "like ", 4 + 2, " apples");
10// This would print:
11// I'D LIKE 6 APPLES
12