PHP Compare Two Arrays?
Posted
by Sjwdavies
on Stack Overflow
See other posts from Stack Overflow
or by Sjwdavies
Published on 2010-03-16T16:55:04Z
Indexed on
2010/03/16
17:41 UTC
Read the original article
Hit count: 312
I'm trying to compare two entries in a database, so when a user makes a change, I can fetch both database entries and compare them to see what the user changed, so I would have an output similar to:
User changed $fieldName from $originalValue to $newValue
I've looked into this and came accross array_diff but it doesn't give me the output format I need.
Before I go ahead and write a function that does this, and returns it as a nice $mtextFormatDifferenceString, can anyone point me in the direction of a solution that already does this?
I don't want to re-invent the wheel..
© Stack Overflow or respective owner