jeudi 21 juillet 2016

PHP - Subtract value from 2 arrays where key = is the same

Im not sure if ive wrote the question properly but ill elaborate more on what i need.

I have two arrays with keys 1,2,3 but they have different values i need to subtract the values from the array where the keys are the same, I hope this makes sense.

Things ive tried to far

  • Push them both to 1 array and do the math from there (can't figure out how to do this)
  • use array_diff to find the difference in the arrays but didn't work.

All help appreciated any more information needed will be provided



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire