I suggest this:
$event = null;
$lines = explode(PHP_EOL, $message);
foreach($lines as $line) {
// skip empty lines
if(strlen($line) == 0) {
continue;
}
$tokens = explode(':', $line);
// tokens[0] contains the key , e.g. Event Value
// tokens[1]~[N] contains the value (where N is the number of pieces), e.g. -56
// stitch token 1 ~ N
$key = $tokens[0];
unset($tokens[0]);
$val = implode(':', $tokens);
// do your extra logic here, e.g. set $event variable to value
if(strpos($key, 'Event Desc') > -1) {
$event = $val;
}
}
Limitation: your data cannot contain :