3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $file = "/var/www/infolegale/delivery/toto.txt"; $path = explode('.', $file); var_dump($path); $path[count($path) - 1] = "csv"; $finalPath = implode($path); echo $finalPath;
based on FGMVi
Output for 4.3.0 - 7.2.0
array(2) { [0]=> string(33) "/var/www/infolegale/delivery/toto" [1]=> string(3) "txt" } /var/www/infolegale/delivery/totocsv