i have the fowling code in my project:
$title = "In this title we have the word GUN"
$needed_words = array('War', 'Gun', 'Shooting');
foreach($needed_words as $needed_word) {
if (preg_match("/\b$needed_word\b/", $title)) {
$the_word = "ECHO THE WORD THATS FIND INSIDE TITLE";
}
}
I want to check if $title
contains one of 15 predefined words,
for example lets say:
if $title
contains words "War, Gun, Shooting" then i want to assign the word that is find to $the_word
Thanks in advance for your time!