User Tools

Site Tools


uphp:functions:unpack

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

uphp:functions:unpack [2019/12/20 09:36]
admin created
uphp:functions:unpack [2021/09/13 05:57]
Line 1: Line 1:
-======unpack====== 
  
-<badge>WMMEGA FW >= 2.1167</badge> 
- 
-<html>unpack — Unpack data from binary string</html> 
- 
-====Description==== 
- 
-<well size="sm"><html> 
-<span style="font-size:125%;color:green">mixed 
-<span style="color:black">pack ( 
-<span style="color:green">string 
-<span style="color:blue">$format<span style="color:black">, 
-<span style="color:green">binary string 
-<span style="color:blue">$value 
-<span style="color:black">) 
-</html></well> 
- 
-<html>Unpacks from a binary string into an array according to the given format. </html> 
- 
-====Parameters==== 
- 
-<html><b><span style="color:blue">$format<span style="color:black"></b>:  <b><span style="color:green">String<span style="color:black"></b> containing one of the following values:</html> 
-^ Value  ^ Description                                      ^ 
-| l      | signed long (always 32 bit, machine byte order)  | 
-| L      | unsigned long (always 32 bit, machine byte order)  | 
-| f      | floating point(always 32 bit, machine byte order)  | 
-| c      | signed byte   | 
-| C      | unsigned byte | 
- 
-<html><b><span style="color:blue">$value<span style="color:black"></b>: Value is a binary string passed by reference (&). 
- 
-====Return Values==== 
- 
-<html><b><span style="color:green">mixed<span style="color:black"></b></html>:  Unpacked value from binary string 
- 
-====Example==== 
- 
-<code php> 
-<? 
-  v=-1234; 
-  $str=pack("l",$v); 
-  print("\r\nPacked signed long:\r\n"); 
-  for ($i=0;$i<4;$i++) { 
-    $c=charat($str,$i); 
-    printf("%02X ",$c); 
-  } 
- 
- 
-  print("\r\nUn packed signed long:\r\n"); 
-  $v=unpack("l",&$str); 
- 
-  print($v); 
-?> 
-</code> 
- 
-====See Also==== 
- 
-[[pack()]] - Pack a binary string 
uphp/functions/unpack.txt · Last modified: 2021/09/13 05:57 (external edit)