Array Remove First

@param array & $array
@param int     $count = 1

@return array
558218
protected static function arrayRemoveFirst(Array $array, Int $count = 1) : Array
    {
        for( $i = 0; $i < $count; $i++ )
        {
            array_shift($array);
        }

        return $array;
    }
588466
public function removeFirst(): self
    {
        $tmpArray = $this->getArray();

        \array_shift($tmpArray);

        return static::create(
            $tmpArray,
            $this->iteratorClass,
            false
        );
    }
6615
private function formatCommaSeparated($collection, $count)
    {
        $display = \array_map(function ($element) {
            return (string) $element;
        }, \array_slice($collection, 0, $count - 1));

        return $this->translator->trans('comma_separated', [
            '%list%' => \implode(', ', $display),
            '%last%' => (string) \end($collection),
        ], $this->catalogue);
    }
1056230
private function removeValuesWithPasswordKeys($array, &$passwordRemoved = false)
    {
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $value = $this->removeValuesWithPasswordKeys($value, $removedChild);
                if ($removedChild) {
                    $array[$key] = $value;
                    $passwordRemoved = true;
                }
            } else {
                foreach ($this->auditRequestIgnoreKeys as $ignoreKey) {
                    if (stripos($key, $ignoreKey) !== false) {
                        $array[$key] = '*password removed*';
                        $passwordRemoved = true;
                        continue;
                    }
                }
            }
        }
        return $array;
    }
669966
protected function trimString($string, $count = 1000)
    {
        $string = trim($string);

        if ($count < mb_strlen($string)) {
            return mb_substr($string, 0, $count - 3).'...';
        }

        return $string;
    }
120861
protected function sortByArray($array, $order)
    {
        $keys = array_keys($array);
        
        return array_merge(
            array_flip(
                array_intersect($order, $keys) +
                array_diff($keys, $order)
            ),
            $array
        );
    }
1059603
public function removeRange($index, $count){
		
		if($this->_ReadOnly){
			throw new ReadOnlyException(\get_called_class() . ' is read only');
		}
		
		if(!$this->offsetExists($index)){
			throw new \OutOfRangeException('$index is invalid');
		}
		
		\array_splice($this->_Arr, $index, $count);
		
		return $this;
		
	}
1327815
public static function forget(&$array, $keys)
	{
		$original = &$array;

		$keys = static::toArray($keys);

		if (count($keys) === 0)
			return;

		foreach ($keys as $key) {
			// if the exact key exists in the top-level, remove it
			if (static::exists($array, $key)) {
				unset($array[(string) $key]);
				continue;
			}

			$parts = static::toKey($key);

			// clean up before each pass
			$array = &$original;

			while (count($parts) > 1) {
				$part = $parts->shift();

				if (static::exists($array, $part) && static::accessible($array[$part]))
					$array = &$array[$part];
				else
					continue 2;
			}

			unset($array[$parts->shift()]);
		}
	}
1296840
protected function prepareArray(array $collection, array $exclude)
  {
    foreach ($collection as $key => $value)
    {
      if ($this->exclude($key, $exclude) === false)
      {
        $collection[$key] = $this->prepareArrayValue($value, $this->excludeNext($key, $exclude));
      }
      else
      {
        unset($collection[$key]);
      }
    }

    return $collection;
  }
787512
function before(array, count) {
  return isArray(array)
    ? array.slice(0, (!count) ? count : --count)
    : array;
}
1021690
public function removeValue($value, array &$array): bool
    {
        if (false !== ($intPosition = array_search($value, $array))) {
            unset($array[$intPosition]);

            return true;
        }

        return false;
    }
584933
public static function removeValue(&$array, $key, $default = null)
    {
        if (is_array($array)) {
            $value = static::getValue($array, $key, $default);
            unset($array[$key]);
            return static::value($value);
        }
        return self::value($default);
    }
1250813
public function shift($count = 1)
    {
        $return = array();

        if ($count == 1) {
            return array_shift($this->dirParts);
        }

        for ($i=0; $i<$count; $i++) {
            $value = array_shift($this->dirParts);

            if ($value === null) {
                break;
            }

            $return[] = $value;
        }

        return $return;
    }
320853
public function first(array $elements, $amount = 1)
    {
        $elements = array_slice($elements, 0, $amount);

        return count($elements) == 1 ? reset($elements) : $elements;
    }
929320
public function slice(int $count) : self
    {
        $list = $this->list;
        $listCount = $list->count();
        $new = new \SplFixedArray($listCount - $count);

        foreach ($new as $index => $val) {
            $new[$index] = $list[($index + $count)];
        }

        return new static($new);
    }
173738
function removeFromArray(array, value) {
    var idx = array.indexOf(value);
    if (idx !== -1) {
      array.splice(idx, 1);
    }
    return array;
  }
1044584
public static function trimRecursive(array $array)
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($array)) {
            return [];
        }

        $result = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $result[$key] = self::trimRecursive($value);

                continue;
            }

            if (is_string($value)) {
                $value = trim($value);
            }

            $result[$key] = $value;
        }

        return $result;
    }