What is PHP for C# ReadBytes(stream langth)?

Posted by Ole Jak on Stack Overflow See other posts from Stack Overflow or by Ole Jak
Published on 2010-06-18T14:09:40Z Indexed on 2010/06/18 14:13 UTC
Read the original article Hit count: 203

Filed under:
|
|
|
|

What is PHP for C# (asuming we open some local (on server) file instead of OpenFileDialog

        private const int HEADER_LENGTH = 13;
        stream = File.OpenRead(openFileDialog.FileName);
        header = ReadBytes(stream, HEADER_LENGTH);

And will we be able to do something like this in PHP as a next step

    private const byte SIGNATURE1 = 0x46;
    private const byte SIGNATURE2 = 0x4C;
    private const byte SIGNATURE3 = 0x56;
      if ((SIGNATURE1 != header[0]) || (SIGNATURE2 != header[1]) || (SIGNATURE3 != header[2]))
            throw new InvalidDataException("Not a valid FLV file!.");

© Stack Overflow or respective owner

Related posts about c#

Related posts about php