How can I compare two arrays depending on the order for ex. if array 1 is {1, 2 , 3} and array 2 is {1,2,3} display true else for ex. array 2 {1,3,2} display false.. this is my code so far..
foreach($questions as $question){
$question_answers = OrderingAnswer::where('question_id', $question->id)
->where('deleted',0)
->get()
->toArray();
$question_answer = $request->except('_token', 'test_id');
$answers = $question_answer[ $question->id];
foreach($question_answers as $answer){
if($answers === $question_answers ){
echo "true";
}
else{
echo "false";
}
}
}