Brian W Posted April 9, 2009 Share Posted April 9, 2009 Here it the error I get: Unsupported operand types in E:\wwwroot\test\asl_reports\asl_report_functions.php on line 104 Line 104 is: $this->sub_totals[$Initials] = $this->sub_totals[$Initials] + $Hours; $Initials is a string that will be something like "I J M" or in my case, "B M W". At the beginning of the class, I declare "Public $sub_totals = array();", is that correct? 104 is the first time I try appending anything to the array. I hope that is enough information. Any help is appreciated, thanks. Link to comment https://forums.phpfreaks.com/topic/153389-solved-unsupported-operand-types/ Share on other sites More sharing options...
Brian W Posted April 9, 2009 Author Share Posted April 9, 2009 it occurred to me that it may not be talking about the array... it was talking about what I was trying to add to what. Now I'm using $this->sub_totals[$Initials] = floatval($this->sub_totals[$Initials]) + floatval($Hours); It works now, thanks for looking though Link to comment https://forums.phpfreaks.com/topic/153389-solved-unsupported-operand-types/#findComment-805874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.