The array_pop function deletes the last element of an array.

    
    $states = ['Idaho', 'Texas', 'Maine'];

    array_pop($states);

    print_r($states);
    // Array ( [0] => Idaho [1] => Texas )