> (14 - $bitIndex)) & 1; echo "Position {$i}: bit[{$bitIndex}] = {$bit}\n"; } echo "\n"; // What we actually read back $actualH = "101111001111010"; echo "What we read back horizontally: {$actualH}\n"; echo "Position 13 (col 15): {$actualH[13]} (should be bit[12] = " . (($ourFormat >> (14 - 12)) & 1) . ")\n"; echo "Position 14 (col 14): {$actualH[14]} (should be bit[14] = " . (($ourFormat >> (14 - 14)) & 1) . ")\n";