idk if that is an older form of coding I have never seen anyone code like that, but any ways this just don't work
if ($2 = !$isalnum)
best to use what Jethro_ told you
if ($2 !isalnum)