3v4l.org

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

preferences:
42.77 ms | 402 KiB | 5 Q