@jZero/

php arrays

PHP (Legacy)

Basic array syntax for PHP.

fork
loading
main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$myArray = array("Rob", "Kristen", "Tommy", "Ralph");

print_r($myArray);

echo $myArray[1];
echo $myArray[0];

$anotherArray[0] = "34";
$anotherArray[5] = "Very";

print_r($anotherArray);

$languagesArray = array("France" => "French", "USA" => "English", "Spain" => "Spanish");

print_r($languagesArray);

echo sizeof($languagesArray);
PHP 7.0.8 (Legacy: use the following for new features: Command-line PHP: https://repl.it/languages/php_cli PHP Web Server: https://repl.it/languages/php7