3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = '/test/path/controller'; $lastslash = strrpos($path, '/'); $upper_path = substr($path, 0, $lastslash+1) . strtoupper(substr($path, $lastslash+1, 1)) . strtolower(substr($path, $lastslash + 2)); echo $upper_path;

preferences:
38.18 ms | 402 KiB | 5 Q