Skip to content

Instantly share code, notes, and snippets.

@Kurinkitos
Last active December 9, 2016 12:09
Show Gist options
  • Save Kurinkitos/aa55a22cab9a60ba9cadaf230d5aa8e3 to your computer and use it in GitHub Desktop.
Save Kurinkitos/aa55a22cab9a60ba9cadaf230d5aa8e3 to your computer and use it in GitHub Desktop.
<?php
$array_length = 19;
$row_length = 3;
$min_value = 1;
$max_value = 100;
$array = array($array_length);
for($i=0; $i < $array_length; $i++){
$array[$i] = mt_rand($min_value, $max_value);
}
for($i=0; $i < $array_length; $i++){
if(($i+1) % $row_length == 0 or $i == $array_length -1){
echo $array[$i] . "<br>";
}else{
echo $array[$i] . ", ";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment