In terms of the formula you gave, so far, we have accounted for only the bolded part:
$per24 = (
$totalHashingPower *
25 / $difficulty) * (
60 * 60 *
24 * 65535 * pow(10,6) / pow(2,48));
Now if you want to use
difficulty, D, instead of the estimated total hash rate you use the formula given here:
https://en.bitcoin.it/wiki/Difficultyn = D(2
48 / 0xffff)
0xffff = 65535 so we have:
n = D(2
48 / 65535)
Substituting into the formula in the previous post:
c = (25)(6)(24)(y/(D(2
48 / 65535)))
c = y(25)(6)(24)(65535)/(D(2
48))
So in your formula we have accounted for:
$per24 = (
$totalHashingPower *
25 /
$difficulty) * (
60 * 60 *
24 *
65535 * pow(10,6) /
pow(2,48));
Finally, the 10
6 factor is just so you can enter your hashing rate ($totalHashingPower) in MH/s instead of H/s. This leaves the following parts of the formula as
wrong:
$per24 = ($totalHashingPower * 25 / $difficulty) * (6
0 * 60 * 24 * 65535 * pow(10,6) / pow(2,48));
The corrected formula ($totalHashingPower in MH/s) is:
$per24 = ($totalHashingPower * 25 / $difficulty) * (6 * 24 * 65535 * pow(10,6) / pow(2,48));