- array_map: documentation ( source)
- vsprintf: documentation ( source)
- print_r: documentation ( source)
<?php
$name = ['John', 'Brian', 'Raj'];
$salary = ['500', '1000', '2000'];
$dpart = ['HTML', 'CSS', 'PHP'];
$address = ['Floor 3', 'Floor 5', 'Floor 6'];
print_r(
array_map(
fn(...$col) => vsprintf("%s's salary is %d, depart is %s, address is %s", $col),
$name, $salary, $dpart, $address
)
);