+1  A: 

If you just cast the number to an integer in PHP, it will do the trick.

echo (int)3232240316 . "\n";

gives

-1062726980

Note: if you want to cast a signed int to an unsigned int in PHP, just do this:

$number += 4294967296;

Example:

$number = -1062726980;
echo $number . "\n";
$number += 4294967296;
echo $number . "\n";

gives:

-1062726980
3232240316
FWH
Sorry, but that won't work on some 64-bit systems, where PHP int is 64-bit by default.
Alex
A: 

This:

$val = (bccomp("2147483647", $val) < 0) ? bcsub($val, "4294967296") : $val;

seems to work, even though it's somewhat slow.

Alex