- print_r: documentation ( source)
- end: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$nickname = "hello1";
if(preg_match_all('!\d+!', $nickname, $numbers)){
if (isset($numbers[0])){
print_r(end($numbers[0]));
}else{
echo "not array";
}
}else{
echo "not found";
}