Re: how to compare value between 2 arrays
| From: | Chris | Date: | Wed, 07 Jun 2006 08:05:22 +0000 |
| Subject: | Re: how to compare value between 2 arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237538@lists.php.net to get a copy of this message | ||
weetat wrote:
Hi all, I am using php 4.3.2 in Red hat enterprise. Have some issue which need some advice from php experts here. I need to compare value between 2 arrays . The arrays data are populated by data from the database resultset. The database resultset fields are the same type and name. for example , serial_no is PK field. in resultset 1 , have field serial_no = '123456' country = 'England' and city = 'London' in resultset 2 , have field serial_no = '123456' country = 'England' and city = 'Manchester As you can see , the city value is different between the 2 resultset. So i will update status fields in the resultset 1 to 'Update'.If the same is 'New' ,and so on.http://www.php.net/array_diff will do it for you. -- Postgresql & php tutorials http://www.designmagick.com/