Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Dado um array com os seguintes valores
- 56
- 78
- 90
- 34
- 36
- 45
- 78
- 90
- 32
- 17
- Verificar o indice dos numeros que são maiores
- que 50.
- Imprimir o indice e o valor
- */
- $meuArray = array(56,78,90,34,36,45,78,90,32,17);
- for ($i=0; $i<count($meuArray); $i++) {
- if ($meuArray[$i]>50)
- { echo "$i $meuArray[$i]";
- echo "<br>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment