R
R
rusgayfer2018-01-27 20:22:24
PHP
rusgayfer, 2018-01-27 20:22:24

How to make a regular expression to search for words in a text?

I do so

$keywords_post = '#[email protected]_fc,#[email protected]_fc,#instagram,#[email protected]_fc,#[email protected]_fc,#[email protected]_fc,#[email protected]_fc,#[email protected]_fc,echo,sky';
$keywords_post = str_ireplace(',', "|", $keywords_post);

if(preg_match("#{$keywords_post}#i", mb_strtolower($a_post->response->items[$it]->text)))

finds ordinary words separated by commas, but not with hashtags. How to fix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question