3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $filenameNew = 'PX20170713_103320_2651093_00001'; $filenameOld = '5956e5781e4f1-20170630_233347_5712837_00001'; var_dump(implode(array_slice(explode('_', rtrim(basename($filenameOld), ".xml" )), 0, 2)));
based on e3jg8
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
string(28) "5956e5781e4f1-20170630233347"