Posted By

Scooter on 07/19/08


Tagged

regular expressions


Versions (?)



Who likes this?

3 people have marked this snippet as a favorite

sumandahal
vali29
silentbob84


isAlpha


Published in: PHP 



Website Promotion
DIRECTORY
is a crucial factor for all websites that need to gain better organic search engine rankings and increase website traffic.
Submitting your website as part of your Web Promotion strategy to our SEO friendly and high traffic Business Directory for review is an excellent way to gain a valuable backlink and increase your websites visibility online.

Submit Site


URL: http://reusablecode.blogspot.com/2008/07/isalphanumeric.html

Expand | Embed | Plain Text
  1. <?php
  2. /*
  3.   Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved.
  4.  
  5.   This work is licensed under the Creative Commons Attribution License. To view
  6.   a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
  7.   send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
  8.   94305, USA.
  9.   */
  10.  
  11. // Checks if a string contains only alpha characters.
  12. function is_alpha($someString)
  13. {
  14. return (preg_match("/[A-Z\s_]/i", $someString) > 0) ? true : false;
  15. }
  16. ?>

Report this snippet 

You need to login to post a comment.