[Solved] How to get value of array inside another array in php?


To echo:

echo $_POST['events'][0];

To assign it to a variable:

$eventid = $_POST['events'][0];

To assign the array to a variable and get the value from the new array:

$events = $_POST['events'];
$eventid = $events[0];

[0] represents the key of the first value since it is set to be 0.

4

solved How to get value of array inside another array in php?