If then statement confusion

#!/bin/bash
PH=(KD 6S TC 3D)                 #playerhand
TCIP=(AH)                               #topcard in play
A=( "${TCIP[@]::1}" )               # A
B=( "${TCIP[@]:1}" )                # H
C=8

for e in ${PH[@]}; do
  if [[ $e =~ $A|$B|$C ]]; then
     echo "$e " >> /home/cogiz/validcards.txt 
  else
     echo "0" >> /home/cogiz/validcards.txt
  fi           
done

In the above code, if ${PH[@]} is scanned for an A,H, or 8 but none of those are found and results are all 0's. How could I then issue a separate command for that situation?

Thank you in advance for any suggestions.
Cogiz

If I understand you correctly, whilst you are in your for loop, you could set a flag within the then section to mark that you have found at least one of them, then after the loop test its value.

Would that help?

Robin