R
R
rusgayfer2018-03-31 19:48:44
PHP
rusgayfer, 2018-03-31 19:48:44

How to check for keywords?

How to do a proper keyword check. For example, I will specify http, https to delete where there are links, etc.
Now I do this:

// Спам слова заношу так, или из базы
$cal['key_text'] = 'спам,продам,куплю';
//Текст здесь $key_text

$key_text = explode(",", mb_strtolower($cal['key_text']));
$key_array = array_merge($key_text);
foreach($key_array as $k) {
if($k == $text) {

// код

}
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kolya K, 2018-03-31
@Kolyagrozamorey

php.net/manual/en/function.preg-match.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question