if ( $w1_h > 128 ) { $word = ($w1_h << 8) + $w1_l; $word = pack ( 's', $word); $word = unpack( 's', $word); }