Your trying to do that are you? Well done 🙂 is your question supposed to be "how can I do this?" then try what laserlight suggested.
It seems to me like this is a long way around this problem. Surely there's an easier way?
$pos = strpos($data, "My name is Jim");
if ($pos === true) {
echo $data1;
} else {
echo data2;
}