Here are two different ways: $istok looks for the token in a list of values separated by the specified character (space, ascii 32 in this case), $regex is a more powerful and general purpose matching syntax.
if ($istok(elephant ship buffalo,$2,32)) { }
if ($regex($2,/elephant|ship|buffalo/iS)) { }