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 query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

browse folder only
hi,
is there a way i can browse or get the directory or folder only and not the file?
i just w

do while...woes
I'm sure this is childsplay but it is stumping me, everytime i try what I think would make this work

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized h

Converting RGB values to HEX
Code: <?PHP

$file_handle = fopen("colors/rgb.csv", "r");

wh

printing links
Hi every1

i am connecting to a table in sql and the looping through with a while ($ var = my

error with opendir
when i do this

if ($handle = opendir($dir)) {
while (false !== ($file = readdir($han

Getting PHP to ammended the selected in option field
Hey Guys

thanks for everyones help so far. This site and its users are oozing awesomness.

Date/Time and Checkbox
Hi Everyone,

I am trying to figure out how to insert the current date and tim

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