its a C# code . plz convert this code to PHP.
string hex_code; if ((FileUpload1.PostedFile != null) && (FileUpload1.PostedFile.ContentLength > 0)) { FileStream fls = new FileStream(FileUpload1.PostedFile.FileName, FileMode.Open, FileAccess.Read); byte[] blob = new byte[fls.Length]; fls.Read(blob, 0, System.Convert.ToInt32(fls.Length)); hex_code = ByteArrayToString(blob);