1 | <?php |
||
9 | class Text { |
||
10 | |||
11 | /** |
||
12 | * \addtogroup Utility-methods Utility methods |
||
13 | * \brief Helper methods. |
||
14 | * @{ |
||
15 | */ |
||
16 | |||
17 | /** |
||
18 | * \brief Get hashtag contained in a string. |
||
19 | * \details Check hashtags in a string using regex. |
||
20 | * All valid hashtags will be returned in an array. |
||
21 | * [Credis to trante](http://stackoverflow.com/questions/3060601/retrieve-all-hashtags-from-a-tweet-in-a-php-function). |
||
22 | * @param $string The string to check for hashtags. |
||
23 | * @return An array of valid hashtags, can be empty. |
||
24 | */ |
||
25 | public static function getHashtags(string $string) : array { |
||
39 | |||
40 | /** |
||
41 | * \brief Remove html formattation from telegram usernames in string. |
||
42 | * \details Remove the $modificator html formattation from a message containing telegram username, to let the user click them. |
||
43 | * @param $string to parse. |
||
44 | * @param $tag Formattation tag to remove. |
||
45 | * @return The string, modified if there are usernames. Otherwise $string. |
||
46 | */ |
||
47 | public static function removeUsernameFormattation(string $string, string $tag) : string { |
||
79 | |||
80 | } |
||
81 |