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

How to secure my login data to my database?
Hi there,

It may be a stupid question but I don't know how to secure my login data to my data

Is there a more efficient way to code this than what I have?
I have three associative arrays.

$combinedSettings
$userSettings
$defaultSettings

PHP5 - Verifying a secure mail is secure
I need to send an e-mail from a form to a external department and because it contains personal custo

Reading waves
Hi,

I am trying to find a way of finding the highs and lows on a graph line, the line points

Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site

php call servlet
I have done a php backup application .
So there is a form that user pick some files to zip and d

MYSQL INSERT ID NOT WORKING
Code: $id = mysql_insert_id();
header("Location: ./?view=$id");
Why $id pulling blan

question about n
I was looking at some of the things you could do with php and one of the things I have tried is n.<

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

Linking with Foreign Keys
I have been getting an erro when I try and link:

create table Faculty_Specialty (I_Name v

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