3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $filename = "2014-01-12-a23ert78df23456ewr91234df789dfh456hj912er.txt"; $date = substr($filename, 0, 10); // 2014-01-02 $path = str_replace("-","/",$date); // 2014/01/02 echo $path;
Output for 4.3.0 - 7.1.0
2014/01/12