This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Ok so, I'm not at all good at coding but I'm working on a uni assignment and this is throwing me off. Basically, what I'm trying to do is create a payroll system that takes data from 2 different json files (one for tax and one for employee info) and calculates their take-home monthly wage by deducting tax from annual salary.
I don't know if you'll be able to help based on the snippet but I've finally got the code to read both json files but it's throwing this warning:
Warning: foreach() argument must be of type array|object, null given in C:\xampp\htdocs\dap405\payroll\payroll.php on line 7
on this bit of code:
foreach ($taxtables as $band) {
if ($salary > $band ['minsalary'] && $salary < $band ['maxsalary']) {
return $band ['id'];
  }
and I don't know what I've done wrong. Any help?
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PHPhelp/com...