I find the documentation for array_diff and all its variants pretty confusing.
What I want to do is compare two rows in the same table of a MySql database and say whether they are identical or not (apart from the primary key, of course). Is there an easy way to do this using array_diff? Other than that, I would need to extract each row with a different prefix and compare columns individually.
Thanks.
Using array_diff
Moderator: General Moderators
Re: Using array_diff
No need for a function.
Get the two rows of data into PHP. Use unset to remove the primary keys from both; then a simple
will do the trick.
Get the two rows of data into PHP. Use unset to remove the primary keys from both; then a simple
Code: Select all
if ($array1 == $array2)Re: Using array_diff
Many thanks! How simple is that?