I have an array that has an array containing more data stored into one of the keys in the original array.
For example:
$array2 = array('some_data');
$array1 = array(
'username' => $username,
'password' => $password,
'data' => $array2);
The array1 can also have multiple occurrences, another words store data for more then one user. How can I add more “data” to the data array within $array1?
I tried doing
$array1[0]['data'][] = array('diff_data');
but I keep getting errors. Is there a better way to do this?
Thank you.
You can add new data to
and you can acces this data like this:
Where 0 is the index of the array2 element.