You are not returning anything from your function.
function getMyString($SentenceSrc)
{
if (strpos($SentenceSrc,'cloudy') AND (strpos($SentenceSrc,'thunderstorm') OR strpos($SentenceSrc,'T-storm')))
$SentenceVariable = "Cloudy with rainshowers or thunderstorms";
else if (strpos($SentenceSrc,'rain') OR (strpos($SentenceSrc,'Rain')) AND (strpos($SentenceSrc,'thunderstorm') OR strpos($SentenceSrc,'T-storm')))
$SentenceVariable = "Partly cloudy with brief rainshowers or thunderstorms";
else if (strpos($SentenceSrc,'Sun') OR strpos($SentenceSrc,'sun'))
$SentenceVariable = "Sunny";
else if (strpos($SentenceSrc,'Stormy'))
$SentenceVariable = "Stormy";
else
$SentenceVariable = "Partly cloudy with brief rainshowers or thunderstorms";
return $SentenceVariable;
}