PHP - Check for whitespace at beginning of string
Posted
by ITg
on Stack Overflow
See other posts from Stack Overflow
or by ITg
Published on 2010-04-23T22:13:22Z
Indexed on
2010/04/23
22:23 UTC
Read the original article
Hit count: 194
php
|validation
I need to use preg_match to check that only a-z0-9. is used (including full stop(.)). I don't want to replace anything. My problem is that it doesn't notice white space at beginning of a string.
Also, if anyone knows how to check there is no two full stops in a row, I would be very grateful.
What I have so far:
("/[^a-z0-9.]+$/",$request)
Thanks !
© Stack Overflow or respective owner