Yeah! That was pack() function. I had been tried pack() before this. But it just needed some extra binary-hex conversions. Finally it worked. Here is my code.
<html>
<?PHP
$fp = fopen("GTASA.B", 'rb');
$ptr = 0;
$sum = 0;
While($ptr < 202748)
{
fseek($fp, $ptr);
$byte = fread($fp, 1);
$ASCII = ord($byte);
$sum = $sum + $ASCII;
$ptr++;
}
fclose($fp);
$pksum = pack("V", $sum);
$fp = fopen("sum.txt", 'wb');
fwrite($fp, $pksum);
fclose($fp);
?>
</html>
This code reads file GTASA.B, make sum of all bytes in file and then write that sum as unsigned long in little endian byte order.
Thanks for all your help.