Function : array_unset

This is used to remove the the relative key of the entire occurence of a value in an array

Syntax
  array_unset($array, $value)
  
  $array: array which value is expected to be removed
  $value: value which entire occurence is removed from array
   
                  
Sample 1
  $array = [1, 2, 3, 2];

  $array = array_unset($array, 2);

  vdump($array); //[1, 3]
                  
Sample 2
  $array = ['a'=>'foo', 'b'=>'bar', 'c'=>'foo'];

  $array = array_unset($array, 'foo');

  vdump($array); //['b'=>'bar']
                  
To remove the first occurence of a value see array_delete() documentation