array

Estimated reading time: 1 minute

array

$amount = [1,2,3,4];
echo "${amount[1]}";
# two

Associative array

$users = [
  "name" => "kamal",
  "age" => 21,
  "phone" => [
    "office" => 017,
    "home" => 016
  ]
];
echo "${users["name"]}";
# kamal

resources

php