I have an array like this:
$errors = new array();
There are some PHP-variables which contain data:
$errorID = 0;
$errorTxt = 'Success! You have been registered!';
$errorID2 = 1;
$errorTxt2 = 'Failure! Something went wrong!!';
My question is:
Is it possible to add data to the array in this way:
$errors[$errorID] = $errorTxt;
$errors[$errorID2] = $errorTxt2;
Also I'd like to know how do you iterate the array so I can get the value of a certain key? Just wanted to mention that this is an associative array...