fork download
  1. <?php
  2.  
  3. function totalEmployees($levels, $employees_per_level=7) {
  4. $total = 0;
  5. while ($levels>=0) {
  6. $total += pow($employees_per_level, $levels);
  7. $levels--;
  8. }
  9. return $total;
  10. }
  11.  
  12. $levels = 2;
  13. echo 'Total employees count: '.totalEmployees($levels);
  14.  
  15. ?>
Success #stdin #stdout 0.02s 25708KB
stdin
Standard input is empty
stdout
Total employees count: 57