check if string contain only a-z/A-Z


Posted on 16th Feb 2014 07:03 pm by admin

Is where any way to check if string contains only a-z/A-Z, without writing an array with all possible letters and then looping it.

Code:
$available = array('a', 'b', 'c, 'd'); //write a-z

for ($i = 0; $i <= count($available); $i++)
{
$string = str_replace($available[$i], "", $string);
}

if ($string != "")
{
print "Illegal character.";
}

No comments posted yet

Your Answer:

Login to answer
177 Like 41 Dislike
Previous forums Next forums
Other forums

Guixt issue
Hello all,

We are experiencing the following problem with Guixt:

Some transact

Easy administration on MySQL databases
My website is database driven and I am very tired of manually making queries to my tables in order t

change text color with a jQuery code
Hihow can I change the text in a asp:TextBox to a different color when I start typing using jQuery?I

PHP Display Telephone Number On Referrer
I have used the php below to show a different telephone number in the header of the site depending u

Xml parsing
I need a suggestion about parsing xml with multiply parts like pervious...
i.e. different device

php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th

Accessing element of object array
Hello

My object looks like this:


Array ( [0] => User Object ( [id] =>

confused between ' ' and " "
there is a php i set:
$begin_date_query = mysql_query( "SELECT SUBDATE(due_date, INTERVAL $d

DateObject and Nulls
Hi all,

I have an array mapped to a value object. One of the items in the array is a PHP Date

"From field" in PHP email form
I used a wizard to create a PHP email form. I was able to customize it with the exception of the Fr

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash