1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

[Solved] Convert image data into byte array

Discussion in 'Development' started by xBeastMode, Mar 24, 2017.

  1. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    This may not be the best place to ask, but nowhere else could I find an answer. Basically I want to pack image data into an array of bytes.
     
  2. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Nevermind, I found it. Using the unpack() function in PHP:
    PHP:
    $data file_get_contents("image.jpg");
    $bytes unpack("C*"$data);
    //Blah......
     
    Jack Noordhuis likes this.
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    offtopic but is that to display map?
     
  4. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Yes.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.