in reply to Is a integer or string.

or float then I should be doing IF($value1 == $value2)
No. Refer to Why do floating point numeric equality/inequality tests fail mysteriously? for an explanation.