- var_dump: documentation ( source)
- array_walk: documentation ( source)
<?php
$path = null;
$list = array('k1' => 'f1.txt', 'k2' => 'f2.txt', 'k3' => 'f3.txt', 'k4' => 'f4.txt');
//$mapping = array_map(function($item) use ($path) { return $path ? $path . $item : $item; }, $list);
$pfxFilePath = 'pfxFilePath';
$passFilePath = 'passFilePath';
array_walk($list, function(&$item, $i) use ($pfxFilePath, $passFilePath) {
$item.= $pfxFilePath . $passFilePath;
});
var_dump($list);