1 | <?php |
||
31 | class Text |
||
32 | { |
||
33 | /** |
||
34 | * \brief Get hashtag contained in a string. |
||
35 | * \details Check hashtags in a string using a regular expression. |
||
36 | * All valid hashtags will be returned in an array. |
||
37 | * See the following [StackOverflow thread](http://stackoverflow.com/questions/3060601/retrieve-all-hashtags-from-a-tweet-in-a-php-function) to learn more. |
||
38 | * @param $string The string to check for hashtags. |
||
39 | * @return array An array of valid hashtags, can be empty. |
||
40 | */ |
||
41 | public static function getHashtags(string $string) : array |
||
50 | |||
51 | /** |
||
52 | * \brief Convert a string into camelCase style. |
||
53 | * \details Take a look [here](http://www.mendoweb.be/blog/php-convert-string-to-camelcase-string/) |
||
54 | * to learn more. |
||
55 | * @param string $str The string to convert. |
||
56 | * @param array $noStrip |
||
57 | * @return string $str The input string converted to camelCase. |
||
58 | */ |
||
59 | 13 | public static function camelCase($str, array $noStrip = []) |
|
72 | |||
73 | /** |
||
74 | * \brief Remove HTML formattation from Telegram usernames. |
||
75 | * \details Remove the $modificator html formattation from a message |
||
76 | * containing Telegram usernames. |
||
77 | * @param string $string to parse. |
||
78 | * @param string $tag Formattation tag to remove. |
||
79 | * @return string The string, modified if there are usernames. Otherwise $string. |
||
80 | */ |
||
81 | public static function removeUsernameFormattation(string $string, string $tag) : string |
||
107 | |||
108 | /** @} */ |
||
109 | } |
||
110 |