I’d like to put each file name in $xsl_dir_path (absolute path) in select element. I’ve tried this:
$files = glob($xsl_dir_path . "/*.xsl");
array_walk($files, 'basename');
but it’s not working at all, i can still see the full names of the files. I know i can apply basename when lopping through $files and build the option elements, but i’d like to do it before any html output.
array_walkis useful when your callback function accepts a reference or when you use user-defined callback functions. In this case, thebasenameargument is not a reference.What you want is
array_map: