I have an numeric index array here is a portion of the print_r:
Array
(
[0] => Array
(
[from_stop_id] => 1
[to_stop_id] => 1
[transfer_type] => 1
[min_transfer_time] =>
)
[1] => Array
(
[from_stop_id] => 3
[to_stop_id] => 3
[transfer_type] => 1
[min_transfer_time] =>
)
[2] => Array
(
[from_stop_id] => 4
[to_stop_id] => 4
[transfer_type] => 1
[min_transfer_time] =>
)
)
here is my php loop:
for ( $counter = 0; $counter < count($transfers_csv); $counter++) {
echo $transfers_csv[$counter]['from_stop_id'];
echo $transfers_csv[$counter]['to_stop_id'];
echo $transfers_csv[$counter]['transfer_type'];
echo $transfers_csv[$counter]['min_transfer_time'];
}
here is my error output:
Notice: Undefined index: from_stop_id in C:\MAMP\htdocs\wp50\wp-content\plugins\tm-gtfs-data\tm-gtfs-data.php on line 453
11
Notice: Undefined index: from_stop_id in C:\MAMP\htdocs\wp50\wp-content\plugins\tm-gtfs-data\tm-gtfs-data.php on line 453
31
Notice: Undefined index: from_stop_id in C:\MAMP\htdocs\wp50\wp-content\plugins\tm-gtfs-data\tm-gtfs-data.php on line 453
41
I cannot understand WHY it is giving me an undefined index when I know the following. $transfers_csv is AN Numeric Indexed Array. I can see from the output that there are values for 'from_stop_id', for 'to_stop_id' and 'transfer_type' but 'min_transfer_type' value is empty or NULL.
Anyone see what I am doing wrong here??