Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function remove_hashtags($array)
- {
- return preg_grep("/^(\#(.*))/", $array, PREG_GREP_INVERT);
- }
- $array = [
- "#cette phrase",
- "#celle-ci",
- "mais pas celle-ci",
- "ni celle-ci",
- "#cette phrase aussi"
- ];
- print_r(remove_hashtags($array));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement