Hi,
I have tried it now, but could still not get the results. The resulting array is an associative array, and its index names have to be given in the format string. However the number obtained after unpacking is not the number that was packed...
Here is the srcipt i used to test...
$dump=fopen("dump.txt","w");
$num1=5;
//settype($num1,"integer"); also not works
$num2=15;
//settype($num2,"integer");
$struct=pack("ii",$num1,$num2);
fwrite($dump,$struct,8);
fclose($dump);
$dump=fopen("dump.txt","r");
$struct_read=fread($dump,8);
$array=unpack("inum1/inum2",$struct_read);
//settype($array[num1],"integer");
//settype($array[num2],"integer");
echo("--->".$array[num1]."<---<br>");
echo("--->".$array[num2]."<---<br>");
fclose($dump);
Heres is the o/p
--->1546673157<---
--->254827568<---
now where could the problem be?
Waiting for your comments/replies,
Alok