- substr: documentation ( source)
- var_dump: documentation ( source)
- strrpos: documentation ( source)
- array_walk: documentation ( source)
<?php
$tests = ['derp.php', 'test.php'];
array_walk($tests, function(&$test) {
$test = substr($test, 0, strrpos($test, '.'));
});
var_dump($tests);