>>34
filter_inputを使ってみてはどうか?

$handnum = filter_input(INPUT_POST, 'handnum', FILTER_SANITIZE_NUMBER_INT);
$player_hand = intval($handnum);