3v4l.org

run code in 300+ PHP versions simultaneously
<?php function normalise($string) { preg_match('~[a-z0-9]+$~i', $string, $match); if ( ! isset($match[0])) { return false; } return strtoupper($match[0]); } echo normalise('Deu-12345tx'), PHP_EOL;

preferences:
37.9 ms | 402 KiB | 5 Q