Welcome Guest, Not a member yet? Register   Sign In
Solved: symbol validation check question
#4

(04-05-2018, 11:17 AM)jreklund Wrote: Personally I would match characters I want instead of those I don't want. Right now you can use chines letters in your folder name, are you allowed to do so?

PHP Code:
$re '/\W/'// \W matches any non-word character (equal to [^a-zA-Z0-9_])

$str $this->input->post('folder');

$is_correct_foldername = !preg_match($re$str) ? true false

This will give you false on every character except:
a-z
A-Z
0-9
_

And spaces?
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: Solved: symbol validation check question - by wolfgang1983 - 04-05-2018, 03:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB