I need to convert an integer value to a 2 byte array and then to a 2 character string to write to a text file. I obtain the value from the file using:
$fhandle = fopen($this->FilePath, 'r');
$myVal = unpack('S',fread($fhandle, 2));
echo 'My Val = '.$myVal; //let's say that $myVal = 1234
How do I convert the value back to the original format from an integer?