Skip to content

Instantly share code, notes, and snippets.

@luzzardi
Created May 27, 2015 13:19
Show Gist options
  • Save luzzardi/d492b534848e0af36f20 to your computer and use it in GitHub Desktop.
Save luzzardi/d492b534848e0af36f20 to your computer and use it in GitHub Desktop.
<?php
$matriz = array(); // [] significa iniciar um array vazio em php.
$i = 0; // Indice da matriz inicial
$j = 0; // php nao tem definição de tipos, ele vai assumir o valor que eu passar, no caso i e j serão Inteiros (int)
for ($i = 0; $i < 10; $i++) {
for ($j = 0; $j < 10; $j++) {
matriz[$i][$j] = rand(); // PHP tem a função rand que retorna um numero random.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment