Skip to content

Commit bbaec0c

Browse files
committed
Create 03_arrays.php
PHP Arrays
1 parent be4939d commit bbaec0c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

03_arrays.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<pre>
2+
<?php
3+
//Eng: simple Array
4+
//Pt: Array simples
5+
$numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; //int
6+
7+
$fruits = array('apple_maca', 'orange_laranja','banana', '...'); //strings
8+
9+
/*
10+
*Eng:arrays have an index to define the position where the element is located, starts counting from zero to.
11+
*
12+
*Pt:arrays possuem um índice para definir a posição onde o elemento está localizado, começa a contar de zero a..
13+
*/
14+
15+
//output , saída (php-html):
16+
echo "<h3>numbers: index zero -- element: {$numbers[0]} </h3>";
17+
18+
echo "<h3>numbers: index five -- element: {$numbers[5]} </h3>";
19+
20+
echo "<h3>fruits: index one -- element: {$fruits[1]} </h3>";
21+
22+
//output, saída:
23+
var_dump($numbers);
24+
var_dump($fruits);
25+
?>
26+
</pre>

0 commit comments

Comments
 (0)