php - if two array has identical values in same format irrespective of key without using any loop -


array1 = (a=>1, b=>2, c=>3, d=>1 ) array2 = (g=>1, d=>2, f=>3, e=>1 ) 

i cannot use === operator keys different. above 2 arrays has same value format, want display yes if have, can run loop want avoid part.

you may looking array_values():

<?php $array1 = ['a'=>1 ,'b'=>2, 'c'=>3, 'd'=> 1]; $array2 = ['g'=>1 ,'d'=>2, 'f'=>3, 'e'=> 1];  var_dump(array_values($array1)===array_values($array2)); // bool(true) ?> 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -