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.
glob()will always serve the full file paths. If you don't want that, you need to cut it off afterwardsbasename()doesn't conform with the kind of callback thatarray_walk()needs - you would have to build a custom function that modifies the first argument directly