DEV Community

Discussion on: Daily Challenge #40 - Counting Sheep

Collapse
 
peter279k profile image
peter279k

Here is the simple solution with PHP:

function countsheep($num){
  $sheepString = "";

  for ($index=1; $index<=$num; $index++) {
    $sheepString .= (string)$index . " sheep...";
  }

  return $sheepString;
}