View Single Post
  #116 (permalink)  
Old 10-17-2007, 11:11 PM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Re: Using Arrays in PHP

hi,

array 1 match up to the correct values in array 2

array 1 array 2
1 4
2 1
3 3
4 5
5 2

<?php
$a1 = array(1, 2, 3, 4, 5);
$a2 = array(4, 1, 3, 5, 2);

var_dump(! (bool) array_diff($a1, $a2));
?>

Will print true if both arrays have the same values.
Reply With Quote