mmm, don't the ereg functions even support assertion π? I thought they would.
anyway, I'm pretty sure that
preg_match( "/^[a-zA-Z0-9]+$/", $variable)
should work (I would have recommended the preg functions anyway, much more powerful once you get on with regular expressions).