code: private function long2str($v, $w) 
  	{
  		$len = count($v);
  		$n = $len << 2;
  		if ($w) {
  			$m = $v[$len - 1];
  			$n -= 4;
  			if (($m < $n - 3) || ($m > $n)) {
  				return false;
  			}
  			$n = $m;
  		}
  		
  		$s = [];
  		for ($i = 0; $i < $len; $i++) {
  			$s[$i] = pack("V", $v[$i]);
  		}
  		
  		if ($w) {
  			return substr(join('', $s), 0, $n);
  		} else {
  			return join('', $s);
  		}
  	}
docs: 长整型转换为字符串
  
  @param long $v
  @param boolean $w
  @return string