<?php $array_1 = ['A', 'B', 'C', 'D', 'E', 'F']; $array_2 = ['B','C', 'D']; $i = 0; $check = false; $match = true; foreach($array_2 as $a){ if($check==false){ for($j=0;$j<sizeof($array_1)-1;$j++){ if($array_1[$j]==$a){ $i=$j+1; $check = true; } } }else{ if($a==$array_1[$i]){ $i++; }else{ $match = false; break; } } } if($match) echo 'true'; else echo 'false';
You have javascript disabled. You will not be able to edit any code.