- var_export: documentation ( source)
- random_int: documentation ( source)
- preg_replace: documentation ( source)
- strtolower: documentation ( source)
<?php
function random_username($string) {
return preg_replace('/(\S+) (\S{2}).*/', '$1$2', strtolower($string)) . random_int(0, 100);
}
var_export(random_username("Mike Test"));