Hello,
I want to define an array in PHP using key value pairs as follows:
$myArray = (
'item1' => 'value1',
'item2' => 'value2',
'item3' => 'value3'
);
But whenever I need to use one of the stored value in this array using numeric index like,$myArray[1] It shows the following error:
Anyone have a solution?
I want to define an array in PHP using key value pairs as follows:
$myArray = (
'item1' => 'value1',
'item2' => 'value2',
'item3' => 'value3'
);
But whenever I need to use one of the stored value in this array using numeric index like,$myArray[1] It shows the following error:
Notice: Undefined offset: 1
Comment