View Single Post
(#1 (permalink))
Old
andyd34 andyd34 is offline
Junior Member
andyd34 is on a distinguished road
 
Posts: 4
Join Date: May 2008
Default Verify form input - 05-10-2008, 07:41 PM

A simple ereg to check only alpha numeric character are entered

PHP Code:
$text "onlyalphanumericcharacters012345";

if (
ereg('[^A-Za-z0-9]'$text)) {
  echo 
"This contains characters other than letters and numbers";
}
else {
  echo 
"This contains only letters and numbers";    

Reply With Quote
Sponsored Links