I need to search a string for a specific word and have the match be a variable. I have a specific list of words in an array:
$names = array ("Blue", "Gold", "White", "Purple", "Green", "Teal", "Purple", "Red");
$drag = "Glowing looks to be +Blue.";
$match = "+Blue";
echo $match
+Blue
What I need to do is search $drag with the $names and find matches with an option + or - character and have $match become the result.