PHP unpack question

7331

New Member
\[code\]list(,$nfields) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;\[/code\]The question is, why \[code\]"N*"\[/code\] if \[code\]substr\[/code\] should return 4 bytes, and they will be unpacked as N? And why double assignment?UPD: This code is part of Sphinx native PHP connector. After some code hacking it became clear that this code extracts 4-byte integer. But logic behind double assignment and \[code\]substr\[/code\] / \[code\]N*\[/code\] is still unclear to me. I'm offering a bounty to finally understand it.
 
Back
Top