That doesn't seem to be an exclusive condition, however. If I try the following:
$vindate = "BG2873";
echo strcmp($vindate, "Q00001").' | '.strcmp($vindate, "S60000").'<br>';
echo strcmp($vindate, "S60001").' | '.strcmp($vindate, "V20000").'<br>';
echo strcmp($vindate, "V20001").' | '.strcmp($vindate, "X40000").'<br>';
echo strcmp($vindate, "A00001").' | '.strcmp($vindate, "D25000").'<br>';
echo strcmp($vindate, "000001").' | '.strcmp($vindate, "099999").'<br>';
echo strcmp($vindate, "X80001").' | '.strcmp($vindate, "Z25000").'<br>';
echo strcmp($vindate, "AE0001").' | '.strcmp($vindate, "CK9999").'<br>';
echo strcmp($vindate, "DC0001").' | '.strcmp($vindate, "FK9000").'<br>';
I expect the second to last check to be the one that it falls in between, however, it falls in between two actually, the fourth condition also showing a gap between positive and negative:
-15 | -17
-17 | -20
-20 | -22
1 | -2
18 | 18
-22 | -24
1 | -1
-2 | -4
I do notice, however that the proper match is closer to zero(1 | -1 vs. 1 | -2). So does that mean I should find the one in between the smallest negative and positive number?
I'm sorry for my density. The man page makes it seem very simple:
Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.
but I'm just not grasping it in practice.