The problem is
('oss'|'OSS'|'noc'|'NOC')
which is a bitwise or on those 4 strings.
Strangely though, this operation seems to work differently on strings than numbers. Considering only the effect of ("oss"|"OSS"), I would have expected the result to be the string "OSS", or the equivalent of the code
$o = dechex(ord("o"));
$o .= dechex(ord("s"));
$o .= dechex(ord("s"));
$O = dechex(ord("O"));
$O .= dechex(ord("S"));
$O .= dechex(ord("S"));
$or = ($o | $O);
Where the result, $or, not surpisingly is 0x6f7373 which corresponds to the byte values for the string "OSS". It does after all correspond to the effect of (1|3), which is 3.
However, the effect of
$or = ("oss"|"OSS");
is "oss", which in my view corresponds to the result of (1|3) being 1. I'd be happy if someone could enlighten me on the why of this.
Anyway, what you want is
if ($value6[$i] != 'oss' && $value6[$i] != 'OSS' && $value6[$i] != 'noc' && $value6[$i] != 'NOC')
// ...
if ($value6[$i] == 'OSS' || $value6[$i] == 'oss'))
And do note the difference between the logical comparison OR operator '||', and the bitwise OR operator '|'.