function simplenews_statistics_encoder_nfact in Simplenews Statistics 7
Same name and namespace in other branches
- 7.2 simplenews_statistics_encoder/encoder.inc \simplenews_statistics_encoder_nfact()
Calculate factorial of a number.
File
- simplenews_statistics_encoder/
encoder.inc, line 10 - Encoder for IDs. Some logic borrowed from shorturl module.
Code
function simplenews_statistics_encoder_nfact($n) {
if ($n == 0) {
return 1;
}
else {
return $n * nfact($n - 1);
}
}