Looks like it should work, I was keeping things simple and following the original code so the OP could follow it.
The real solution would be to to store the UID and matching card numbers in a long long type variable ( 8 bytes ) so you could still use the simple == in an if statement. The matching numbers could be in an array so then it is easy to compare all the matching card numbers you have with the incoming number.