gasp$filenames = array($p); $files = array(); foreach ($filenames as $f){ $files[$f] = file_get_contents($f); }