you better just start experimenting. Refer to the php manual for a list of functions and how to use them.
You'll want to refer to the string functions like stristr() & str_replace() ........
as far as email validation goes, you can find plenty of code snippets to download.