You'd want each part to be of constant length, of course, so you could do it like this (making use of PHP's implied typecasting):
$str_1 = str_pad($EventID, 2, '0', STR_PAD_LEFT);
$str_2 = str_pad($ClassID, 2, '0', STR_PAD_LEFT);
$EventClassID = $str_1 . $str_2;