To use modular exponentiation as you would require when using the Fermat Primality Test with large numbers (100,000+), it calls for some very large calculations.
Whe
0;$i--){ $var = $int1[$i-1] + $int2[$i-1] + $carry; $var = str_pad($var, 2, '0', STR_PAD_LEFT); $var = (string) $var; $carry = $var[0]; $str = $str . $var[1]; } $res = strrev($str.$carry); echo ltrim($res,"0"); } add($int1,$int2); ?>