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 | <<<<<<< HEAD |
||
38 | * |
||
39 | * See the following [StackOverflow thread](http://stackoverflow.com/questions/3060601/retrieve-all-hashtags-from-a-tweet-in-a-php-function) to learn more. |
||
40 | * @param $string The string to check for hashtags. |
||
41 | ======= |
||
42 | * [Credis to trante](http://stackoverflow.com/questions/3060601/retrieve-all-hashtags-from-a-tweet-in-a-php-function). |
||
43 | * @param string $string The string to check for hashtags. |
||
44 | >>>>>>> master |
||
45 | * @return array An array of valid hashtags, can be empty. |
||
46 | */ |
||
47 | public static function getHashtags(string $string) : array |
||
56 | |||
57 | /** |
||
58 | * \brief Convert a string into camelCase style. |
||
59 | * \details Take a look [here](http://www.mendoweb.be/blog/php-convert-string-to-camelcase-string/) |
||
60 | * to learn more. |
||
61 | * @param string $str The string to convert. |
||
62 | * @param array $noStrip |
||
63 | * @return string $str The input string converted to camelCase. |
||
64 | */ |
||
65 | 7 | public static function camelCase($str, array $noStrip = []) |
|
78 | |||
79 | /** |
||
80 | <<<<<<< HEAD |
||
81 | * \brief Remove HTML formattation from Telegram usernames. |
||
82 | * \details Remove the $modificator html formattation from a message |
||
83 | * containing Telegram username. |
||
84 | * @param $string to parse. |
||
85 | * @param $tag Formattation tag to remove. |
||
86 | ======= |
||
87 | * \brief Remove html formattation from telegram usernames in string. |
||
88 | * \details Remove the $modificator html formattation from a message containing telegram username, to let the user click them. |
||
89 | * @param string $string to parse. |
||
90 | * @param string $tag Formattation tag to remove. |
||
91 | >>>>>>> master |
||
92 | * @return string The string, modified if there are usernames. Otherwise $string. |
||
93 | */ |
||
94 | public static function removeUsernameFormattation(string $string, string $tag) : string |
||
120 | |||
121 | /** @} */ |
||
122 | } |
||
123 |