Alpha Validation in PHP

Validate Alpha Characters in PHP

This PHP program will check if the given string is containing only alpha character or other than alpha characters. Here we are going to check it using regular expression with the help of preg_match().
function is_alpha($val)
{return (bool)preg_match("/^([a-zA-Z])+$/i", $val);}

Regular Expression for Alpha Validation


/^([a-zA-Z])+$/i

If the input is like Nscraps,PHP,coding it will return true. for inputs like PHP5.0, coding1 will return false.


Related Topic How to Process XML Documents in Object Oriented Concepts
Biggest Hurdle of XML Schema
What is XML Schema Namespace Recommendation
XML Important Terminology in Object Oriented Programming
How to Create String Color and Dimension Layouts with Simple Value Components

nScraps.com 2011   Privacy Policy  Terms of Service  Feedback