Conditions | 4 |
Paths | 2 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
41 | public function text($text) |
||
42 | { |
||
43 | /* |
||
44 | * Strip whitespace from beginning and end of value |
||
45 | * Make sure there's a value |
||
46 | * Make sure the value isn't all whitespace |
||
47 | * Make sure the value is 2 or more characters |
||
48 | */ |
||
49 | |||
50 | $clean_text = trim($text); |
||
51 | |||
52 | if($clean_text != '' && !ctype_space($clean_text) && strlen($clean_text) >= 2) { |
||
53 | |||
54 | return true; |
||
55 | |||
56 | } else { |
||
57 | |||
58 | return false; |
||
59 | |||
60 | } |
||
61 | |||
62 | } |
||
63 | |||
65 |