suppose each class is described by an array...I'll use a super simple scheme here....
$class1['start'] = 1400;
$class1['end'] = 1515;
$class2['start'] = 1500;
$class2['end'] = 1550;
this function will help you find conflicts
function is_conflict($class1, $class2) {
if (($class2['start'] >= $class1['start']) &&
($class2['start'] < $class1['end'])) {
// conflict!
return true;
} else if (($class2['end'] > $class1['start']) &&
($class2['end'] <= $class1['end'])) {
// conflict!
return true;
} else {
return false;
}
} // is_conflict()
that might not be perfect, but i believe it would work for a statement like this:
if (is_conflict($class1, $class2)) {
echo "rats! i have a conflict!";
}