That happens when an associative array contains a value without key in PHP

<?php
$assonum = ['key1' => 'a', 'b', 'key2' => 'c', 'd'];

echo $assonum['key1']; // outputs a
echo $assonum['key2']; // outputs c
echo $assonum[0]; // outputs b
echo $assonum[1]; // outputs d
?>

Comments

Popular posts from this blog

Timus 1209. 1, 10, 100, 1000... accepted solution in C

Timus Problem 1086. Cryptography Accepted Solution in C

Timus 1083. Factorials!!! Accepted Solution in C