i have an array with times and ids and i am adding new times to it with different id and i need to check if it exists first. ex.
first array
$times = array(
array('start'=>"1:00","end"=>"1:59","id"=>1),
array('start'=>"2:00","end"=>"2:59","id"=>1),
array('start'=>"3:00","end"=>"3:59","id"=>1),
array('start'=>"4:00","end"=>"4:59","id"=>1),
array('start'=>"5:00","end"=>"5:59","id"=>1),
array('start'=>"6:00","end"=>"6:59","id"=>1)
);
need to do
$time = array('start'=>"2:00","end"=>"2:59","id"=>2);
if(!in_array($time,$times){ // here is the problem
array_push($times,$time);
}
this is not duplicated because its not about the pair key/value since its always the same its about having the same pair of key/value but checking if a new element - regardless of its id key value - already exists in the array