DanielAttard
asked on
PHP Error - Undefined Index problem
I am receiving the following error:
And here is the code in question:
I don't understand why I am getting this error because the variable $arr_bill_dates is defined at the beginning before the loop. Why is this causing an error? Thanks.
A PHP Error was encountered
Severity: Notice
Message: Undefined index: Jun 10, 2011
Filename: controllers/taxCalcFunction.php
Line Number: 5
And here is the code in question:
$arr_bill_dates = array();
foreach($data['billing_events'] as $billdate) {
foreach($billdate as $event) {
$key = array_keys($event);
$arr_bill_dates[$key[0]]++; } } //<- ERROR ON THIS LINE
$data['arr_bill_dates'] = $arr_bill_dates;
I don't understand why I am getting this error because the variable $arr_bill_dates is defined at the beginning before the loop. Why is this causing an error? Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Ray. I've implemented one of the many different flavors of debug tools found on the link you provided. Now I've got tons of useful, well-formatted information being presented to me to help solve this issue.
Great idea. Thank you.
Great idea. Thank you.
ASKER