| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
![]() Join Date: Jul 2005 Location: Coffs H, Australia
Posts: 3,456
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Remove irregular characters Hi all, Just a small simple snippet to return whether or not irregular characters (anything not on your keyboard) have been used in a string. ????: NamePros.com http://www.namepros.com/code/709703-remove-irregular-characters.html Very useful for rejecting international characters (Generally from bots, SPAM!). I use it to reduce spam for the registration process in my forum hosting system. Code: function isRegular($string)
{
return !preg_match('/[^A-Za-z0-9\s~`!@#$%^&*()-_=+{}:";\'<>?,.\/]/', $string);
} If there is a more optimized way to match regular characters only, i'd love to know! -Rhett.
__________________ Free Forums / GoDaddy Coupon Codes (NEW DOMAIN!) / Free Arcade Script / <?='Your computer is '.(1?fine:broken).'.'?>
Last edited by BillyConnite; 04-07-2011 at 10:25 PM.
|
| | |
| | THREAD STARTER #2 (permalink) |
![]() Join Date: Jul 2005 Location: Coffs H, Australia
Posts: 3,456
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Updated the match, forgot to include to allow spaces
__________________ Free Forums / GoDaddy Coupon Codes (NEW DOMAIN!) / Free Arcade Script / <?='Your computer is '.(1?fine:broken).'.'?> |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| LENDZ.com, viaVOiP.net and about 100 more | circa1850 | Domains For Sale - Make Offer | 0 | 12-22-2006 11:51 AM |
| LENDZ.com, viaVOip.net and about 100 more | circa1850 | Domains For Sale - Auctions | 0 | 12-22-2006 11:50 AM |