To make sure that you compare integer values, you can use intval(Q0.NAOK) > 50
. Just remember if Q0.NAOK is not a number (empty or a string), then intval(Q0.NAOK) === 0. To compare string values ("A" < "B") use strcmp directly : strcmp(Q0.NAOK,"B")
or strcmp(Q0.NAOK,"A5")
.