php array[] code example
Example 1: array php
<?php
$array = array(
"foo" => "bar",
"bar" => "foo",
);
// as of PHP 5.4
$array = [
"foo" => "bar",
"bar" => "foo",
];
?>
Example 2: tab php
$tab = array(); // empty tab
$tab = array("0" => "Hello", "1" => "world"); // $tab[0]="hello" and $tab[1]="world"