PHP code example of desean1625 / structphp

1. Go to this page and download the library: Download desean1625/structphp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

desean1625 / structphp example snippets



$struct = new Desean1625\Struct();

 print_r($struct->unpack("<2h", pack("v2", 10, 10)));//v	unsigned short (always 16 bit, little endian byte order)
 print_r($struct->unpack(">2h", pack("n2", 10, 10)));//n	unsigned short (always 16 bit, big endian byte order)
 print_r($struct->unpack(">2L", pack("N2", 10, 10)));//N	unsigned long (always 32 bit, big endian byte order)
 print_r($struct->unpack("<2L", pack("V2", 10, 10)));//V	unsigned long (always 32 bit, little endian byte order)