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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -