packphp
❶ php pack函数能看到源码吗
如果是字符串的话应该是string类型,对应的是a或者A。可以这样pack('a*',$data1).pack('a*',$data2),当然我只是提个建议,你那种写在一个pack函数里面的我没用过,所以你可以自己验证一下,但是分着写是肯定没问题。如果你想优化的话,可以使用strlen()函数,看一下你的data到底有多长,就没必要使用a*或者是h*了。
❷ PHP对pack后的二进制数据怎么进行位运算
没用过这里, 翻翻手册看看吧
❸ php中的pack:type h:illegal hex digit x怎么解决
^The h format code specifies input as a hex string. It's hard to tell this from the error, but the -between the words digit and line is literally the character that is causing the error (i.e. it's not a separator in the message).
PHP Warning: pack(): Type h: illegal hex digit - line 37
^
In other words, your input is interpreted as a string containing the - character, which is not a legal hex digit (0123456789abcdef).
It's hard to give any specific advice on solving your problem without more information. At the very least, you need to review PHP's implementation of pack.
❹ php程序中pack('I', strlen($data))什么意思
将就使用chr(len(data))吧,有一点区别,PHP这个语句使用的是无符号整数,但是ASP好像没有有符号、无符号的概念。
❺ php pack("N", 280) asp如何写
PHP pack() 函数
PHP 杂项函数
定义和用法
pack() 函数把数据装入一个二进制字符串。
语法
pack(format,args+)
参数 描述
format 必需。规定在包装数据时所使用的格式。
args+ 可选。规定被包装的一个或多个参数。
format 参数的可能值:
a - NUL-padded string
A - SPACE-padded string
h - Hex string, low nibble first
H - Hex string, high nibble first
c - signed char
C - unsigned char
s - signed short (always 16 bit, machine byte order)
S - unsigned short (always 16 bit, machine byte order)
n - unsigned short (always 16 bit, big endian byte order)
v - unsigned short (always 16 bit, little endian byte order)
i - signed integer (machine dependent size and byte order)
I - unsigned integer (machine dependent size and byte order)
l - signed long (always 32 bit, machine byte order)
……
❻ packdown.php是什么意思
虽然抄一楼回答得对,但我认为楼主的问题在于下载的文件变成了php文件
第一,楼主,php文件里面是页面和功能代码,和你要下载的文件无关
第二,这代表你下载没成功
解决办法:
你下载的文件的网站设置了防盗链或下载的文件已经删除,实际下载的只是一个页面文件。你可以尝试在浏览器里右击链接,选择“目标另存为”,用浏览器来下载 ,虽然速度可能慢点,但一般都可以下载,如果连这样下载都不支持,那就真没法下载了。
当然你也可以取消讯雷作为默认下载工具,改为用浏览器下载,开迅雷,在配置里面的监控选项里把监控浏览器取消,再下载就OK了
======================================
再就你本身的问题回答下
packdown指包下载
php是一种web开发语言/环境,.php是它的网页\脚本文件后缀名。
packdown.php这个名字通常是下载或交互页面的名字
❼ php pack 用c#怎么转换
php 的 pack("H*", sha1($api_password))
实际就抄是 sha1($api_password, true)
即只返回二进袭制数据
你在用 C# 写 sha1 函数时也不要转换成十六进制表示,而直接返回 byte 数组就可以
C# 在做这类操作时,都是要将字符串转成 byte 数组后才可以的
❽ 在x86平台上php的pack函数如何构造大端(网络序)32位的有符号整数
<?php//>=5.2.0
functionpackInt32be($i){
if($i<-2147483648||$i>2147483647)
die("Outofbounds");
returnpack('C4',
($i>>24)&0xFF,
($i>>16)&0xFF,
($i>>8)&0xFF,
($i>>0)&0xFF
);
}
functionunpackInt32be($p){
if(ord($p[0])>>7)
return-((~(
((ord($p[0])&0x7f)<<24)
+(ord($p[1])<<16)
+(ord($p[2])<<8)+ord($p[3]))
&0x7fffffff)+1);
elsereturn
(ord($p[0])<<24)
+(ord($p[1])<<16)
+(ord($p[2])<<8)+ord($p[3]);
}
functiontestPacking($a){
$p=packInt32be($a);
$d=unpackInt32be($p);
echo$a.'->'.bin2hex($p).'->'.$d.'<br/>';
}
$a=array(-1,-2147483648,0x12345678,65535,-65535);
foreach($aas$e)testPacking($e);
没有预置的,只好手写了一套编码解码了
html">原整数->编码后字节->解码后整数
-1->ffffffff->-1
-2147483648->80000000->-2147483648
305419896->12345678->305419896
65535->0000ffff->65535
-65535->ffff0001->-65535
❾ php debug pack 怎么用
对于复使用者而言,这个制 php debug pack 是毫无意义的
这个包是提供给开发人员的,如果你会 C++ 那么你就应该知道,C++工程产生的文件都保存于 debug 目录中的
虽然 php 是开源的,但他的核心代码并不开源的,而是以 lib 形式提供给开发者的
❿ php pack函数
$num = array( 'value'=>'54','type'=>'i1');
pack(strtolower($data['type']), trim($data['value']));
最好使用英文名称,pack会根据数据类型对你的数据进行打包,数据类型是有有格式的,给你个参考网站
http://www.w3school.com.cn/php/func_misc_pack.asp
如果你要是多个数据传一起发送的话,可以定义一个大点的数组,使用foreach()函数对数组进行遍历,在组成一个长的字符串。如果还有不明白的可以继续问我