DEV Community

loading...

Discussion on: Daily Challenge #40 - Counting Sheep

Collapse
mangelsnc profile image
Miguel Ángel Sánchez Chordi

PHP

 <?php

 $totalSheeps = abs(intval($argv[1]));

 for ($i = 1; $i <= $totalSheeps; $i++) {
     echo "$i sheeps...";
 }

 echo PHP_EOL;