Link to home
Start Free TrialLog in
Avatar of DanielAttard
DanielAttardFlag for Canada

asked on

PHP Error - Undefined Index problem

I am receiving the following error:


A PHP Error was encountered

Severity: Notice

Message: Undefined index: Jun 10, 2011

Filename: controllers/taxCalcFunction.php

Line Number: 5

Open in new window


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;

Open in new window


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
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DanielAttard

ASKER

Thanks for the advice.  I'll take a step back and look at some of the earlier code to see what's happening there.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.