I would have two arrays, one permanent with a list of cards with their unique number and properties.
The other with the cards in the player's hand.
And when generating a new card, I can select a random card from the first array and check if the player has such a card in the array. If there is, I select another random card again, if not, I show it to the player and stop the selection automaton.
I don't know if I've made myself clear.
I do not have a ready example, but recently I did an example with the selection of skils and there too skils that have reached the maximum level were not offered to the player. Take a look.
c3p