O, right. Well, on your sign up form, you can easily set up a script filter so that it checks the email address and looks for a .edu extension. You should be filtering the email address anyway.
That's one approach, anyhow. This is really now a PHP issue, so may be better in the PHP forum. First, though, how have you set up the registration form. Did you write the form code yourself?