[PHP] 纯文本查看 复制代码 function GetLongBinary($num)
{
return pack("N",$num);
}
function GetShortBinary($num)
{
return pack("n",$num);
}
function GetDummy($count)
{
$str = "";
for($i=0;$i<$count;$i++)
$str .= "\x00";
return $str;
}
function GetBlock($val)
{
$len = strlen($val);
if( $len < 254 )
return chr($len).$val;
else
return "\xFE".GetLongBinary($len).$val;
}
function EchoHeader($errno)
{
$str = GetLongBinary(1111);
$str .= GetShortBinary(202);
$str .= GetLongBinary($errno);
$str .= GetDummy(6);
echo $str;
}
function EchoConnInfo()
{
$version = sqlite_libversion();
$str = GetBlock($version);
echo $version ;
$str .= GetBlock($version);
echo $str;
$str .= GetBlock($version);
echo $str;
}
function EchoConnInfo3()
{
$version = SQLite3::version();
$str = GetBlock($version["versionString"]);
$str .= GetBlock($version["versionString"]);
$str .= GetBlock($version["versionString"]);
echo $str;
}
|