Related Links : Search Engine Optimization | | Search Engine Marketing | Online Marketing | Freelance Programmer| SEO Thailand | SEO Expert | SEO services | PHP Programmer Thailand | SEO Tutorial | What is SEO |

  Home Our SEO Services SEO Expert Consultant Php Programmer Scripts| Email : sachin {at} jainsachin {dot} com

PHP | Unpack data from binary string | Manual | Tutorial | Help

SEO Services



Website Programming in PHP / MYSQL



Friends


    Unpack data from binary string

    unpack

    (PHP 4, PHP 5)

    unpack — Unpack data from binary string

    Description

    array unpack ( string $format , string $data )

    Unpacks from a binary string into an array according to the given format .

    unpack() works slightly different from Perl as the unpacked data is stored in an associative array. To accomplish this you have to name the different format codes and separate them by a slash /.

    Parameters

    format

    See pack() for an explanation of the format codes.

    data

    The packed data.

    Return Values

    Returns an associative array containing unpacked elements of binary string.

    Examples

    Example #1 unpack() example

    <?php
    $array 
    unpack("c2chars/nint"$binarydata);
    ?>

    The resulting array will contain the entries "chars1", "chars2" and "int".

    Notes

    Caution

    Note that PHP internally stores integral values as signed. If you unpack a large unsigned long and it is of the same size as PHP internally stored values the result will be a negative number even though unsigned unpacking was specified.

    See Also


    SEO Tutorial / Articles





    Php / Mysql Tutorial



    Articles



      Portfolio


      SEO by Jainsachin