Matty Matty - 10 months ago 53
PHP Question

PHP: Testing whether three variables are equal

I've never come across this before, but how would you test whether three variables are the same? The following, obviously doesn't work but I can't think of an elegant (and correct) way to write the following:

if ($select_above_average === $select_average === $select_below_average) { }

Answer Source
if ((a == b) && (b == c)) {
   ... they're all equal ...

by the transitive relation