Codice PHP:
echo array_pop(explode('_',$stringa));