note 37486 added to function.array-diff

From: Date: Mon, 17 Nov 2003 14:04:22 +0000
Subject: note 37486 added to function.array-diff
Groups: php.notes 
Request: Send a blank email to php-notes+get-60483@lists.php.net to get a copy of this message
a quick way to compare arrays, wether they are multidmensional or not, is simply to serialize them and compare the serialized string returned. of course this works only if the keys are returned in the same order, but in certain cases it may be the quickest way to compare arrays (in my case I am using it for verifying the validity of a mysql table, i.e. the column fields and their types) hope it helps ---- Manual Page -- http://www.php.net/manual/en/function.array-diff.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37486 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37486&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37486&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60483) next »