1 | <?php |
||
11 | class StringFunctions |
||
12 | { |
||
13 | /** |
||
14 | * Formats a string to be used as a username. |
||
15 | * |
||
16 | * @param $username |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | public function formatAsUsername($username) |
||
36 | |||
37 | /** |
||
38 | * Formats a string to be used as an email (specifically strips whitespace |
||
39 | * from the beginning/end of the Email, as well as immediately before/after |
||
40 | * the @ in the Email). |
||
41 | * |
||
42 | * @param $email |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public static function formatAsEmail($email) |
||
57 | |||
58 | /** |
||
59 | * Returns true if a string is a multibyte string |
||
60 | * |
||
61 | * @param string $string |
||
62 | * |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function isMultibyte($string) |
||
69 | |||
70 | /** |
||
71 | * Make a string's first character uppercase |
||
72 | * |
||
73 | * @param string $string |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | public function ucfirst($string) |
||
86 | } |
||
87 |