How to apply a "without" filter in a plugin I have and array of with allEntries and an array with alreadyUpdatedEntries. I would like to filter out all the alreadyUpdatedToEntries to end up with an array of notUpdatedEntries. Like how it is done in Twig.

{% set notUpdatedEntries = allEntries|without(alreadyUpdatedEntries) %}


Is there a similar Craft PHP method to do this in my plugin? Can I maybe include this in my elements criteria query?
You can use similar logic that Craft uses for the withoutFilter in CraftTwigExtension.

public function withoutFilter($arr, $exclude)
{
    $filteredArray = array();

    if (!is_array($exclude))
    {
        $exclude = array($exclude);
    }

    foreach ($arr as $key =&gt; $value)
    {
        if (!in_array($value, $exclude))
        {
            $filteredArray[$key] = $value;
        }
    }

    return $filteredArray;
}