Compare two arrays with unordered items in php -
h have array year,month,day,hour,minute,second (i not know item in array year,month,etc.. it's unordered) have fixed date format like: yy-mm-dd-h-m-s can me. i wrote code , tried underestand true item. function ($date,$format) { $year = $month = $day = $hour = $minute = $second = 0; $format = 'yy-mm-dd-h-m-s'; //string $date = (1998,12,31,23,44,49) ; // array $format = explode("-",$format); $date = explode("-",$date); $date = array_filter(array_unique($date)); $format = array_filter(array_unique($format)); for($i=0;$i<6;$i++) { if($format[$i] == 'yy') $year = $date[$i]; elseif($format[$i] == 'mm') $month = $date[$i]; elseif($format[$i] == 'dd') $day = $date[$i]; elseif($format[$i] == 'h') $hour = $date[$i]; elseif($format[$i] == 'm') $minute = $date[$i]; elseif($format[$i] == 's') $second = $date[$i]; } echo $year.$month.$day; } but got error: notic...