codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php $postEmail = 'user@university.ac.uk'; // as $_POST["uni_email"] if (empty ($postEmail)) { $emailErr2 = "University email is required"; } else { $uemail = $postEmail; if ( !filter_var($uemail, FILTER_VALIDATE_EMAIL)) { $emailErr3 = "Invalid email format"; echo $emailErr3; } } if (substr(trim($postEmail), -6) === '.ac.uk') { echo 'email is correct'; } else { $emailErr3 = "Invalid university email format"; echo $emailErr3; } ?>
Private
[
?
]
Run code
Submit