I 'm thinking about using Binary file to store a index.
But ............
//----------Constant-----------------------
$record_length=158;
$record_format="aa50a20Va40aIIIa4a20Vaa";
//-----Test programme, making a test index with only one record------
$string=pack($record_format , "1","test","bbb",
"983696470","","40","38","1","2","test","aaa","993436669","0","");
$fp=fopen("test.txt","wb");
fwrite($fp,$string);
fclose($fp);
//------problem is here--------------
$string_data = fread($fp , $record_length);
$a_info=unpack($record_format, $string_data);
I can see that $string_data is OK, got all the data from the file.
and $a_info is the result of unpacking. but $a_info has only 1 element , and it's empty ........ why??????
thanx very much
(PS: sorry for my poor English)