$lang = array(
\'thank you\'=>\'You are welcome\',
\'thanks\'=>\'You are welcome\',
\'thank ya\'=>\'You are welcome\'
);
While I am reticent to offer up a code solution when you've admitted you are new to the language and just haven't researched it well, I'm going to hope that this project is you playing with the language to learn it as opposed to jumping in head first to give something to a client where it will ultimately not perform well.
Edit: Just saw your "good thing I'm going to college for this" and am I glad I posted to help.
Here's a structure which does what I believe you are seeking to do.
array(
'thank you',
'thanks',
'thank ya'
),
'Hello' => array('hello'),
'Goodbye' => array('goodbye', 'good bye')
);
public static function getStandardization($word) {
$word_lowercase = strtolower($word);
foreach (StandardizeSayings::$CONVERSIONS as $conversion=>$equivalents) {
if (array_search($word_lowercase, $equivalents) !== false) {
return $conversion;
}
}
return '';
}
}
echo StandardizeSayings::getStandardization('thank ya');
?>
It uses a class structure with static members/methods (so no instantiation of the class is needed). It is easy to extend with a pre-defined list of conversions (work is needed to add in additional conversions at runtime.) It should also run fairly fast.