debe haber mas formas, pero aqui te pongo una:
Código PHP:
function comprobar_usuario($nombre){
$permitidos = '0123456789';
for ($i=0; $i<strlen($nombre); $i++){
if (strpos($permitidos, substr($nombre,$i,1))===false){
return false;
}
}
return true;
}