Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

1
Foreach argument not working
Post Flair (click to view more posts with a particular flair)
Post Body

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?

Author
Account Strength
100%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
7,066
Link Karma
2,806
Comment Karma
4,067
Profile updated: 2 days ago
Posts updated: 20 hours ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago