Possible Duplicate:
PHP compare array
I have to compare two arrays in php and print the out put if the both arrays are same but can order elements in any way
ie
$array1=array('a','p','p','l','e');
$array2=array('p','a','e','l');
--- This must return as success because all of the letters in array1 is there in array2
$array1=array('a','p','p','l','e','s');
$array2=array('p','a','e','l');
-- This must return false
$array1=array('a','p','p','l','e','s');
$array1=array('a','p','p','l','e','s');
-- This must return true
Please help