jordanwb Posted December 17, 2007 Share Posted December 17, 2007 If I pass in an array as seen here: <?php $username = "some random username"; $username_parts = explode (" ", $username); if (!eregi("^([0-9a-z])*$", $username_parts)) // Not alphanumeric { $this->form_errors++; } ?> Will that be fine? Quote Link to comment Share on other sites More sharing options...
effigy Posted December 17, 2007 Share Posted December 17, 2007 According to the docs, no: int eregi ( string $pattern , string $string [, array &$regs ] ) Quote Link to comment Share on other sites More sharing options...
jordanwb Posted December 17, 2007 Author Share Posted December 17, 2007 So for eregi to do what I'd want I'd have to loop through each element and count the number of matches. Then compare that to the number of elements in the array. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.