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

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

WHYISNT THIS MYSQL STATEMNT NOT WORKING? (php)
caps because its absolutely rediculous.
i dontunderstand why its not working. there is a column c

pagination numbering pattern
Hello,

I have following code which works great for pagination. but i have small issue now.

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

Code error with Index.php
Error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/runevid/public_

Wierd echo error?
Hi, i got the most wierd php error ever and i don't know why..
Code: echo "<t

Need help with PHP/MySQL drop down menu
I need help on how I can implement a drop down menu which queries mysql database and output the avai

Displaying image from database
Hi,

I've got a site where that's got a database behind it. Currently it has loads of items in

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.

If the program exits normally the por

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