src/ArrayLib.php
/**
     * Removes the specified indexes from the input array before returning it.
     * 
     * @param array $inputArray - the array we are manipulating
     * @param array $indexes - array list of indexes whose elements we wish to 
     *                         remove
     * @param bool $reIndex - override to true if your array needs re-indexing 
     *                        (e.g. 0,1,2,3)
     * 
     * @return array $outputArray - the newly generated output array.
     */
Removes the specified indexes from the input array before returning it.

@param array $inputArray - the array we are manipulating
@param array $indexes - array list of indexes whose elements we wish to
remove
@param bool $reIndex - override to true if your array needs re-indexing

@return array $outputArray - the newly generated output array.
Removes the specified indexes from the input array before returning it . @param array $inputArray - the array we are manipulating @param array $indexes - array list of indexes whose elements we wish to remove @param bool $reIndex - override to true if your array needs re - indexing @return array $outputArray - the newly generated output array .
public static function removeIndexes(array $inputArray, 
                                         array $indexes, 
                                         $reIndex=false)
    {        
        if ($reIndex)
        {
            $outputArray = array();
            foreach ($inputArray as $index => $value)
            {
                if (!in_array($index, $indexes))
                {
                    $outputArray[] = $value;
                }
            }
        }
        else
        {
            foreach ($indexes as $index)
            {
                if (isset($inputArray[$index]))
                {
                    unset($inputArray[$index]);
                }
            }
            $outputArray = $inputArray;
        }
        return $outputArray;
    }
public static function removeIndexes ( array $ inputArray , array $ indexes , $ reIndex = false ) { if ( $ reIndex ) { $ outputArray = array ( ) ; foreach ( $ inputArray as $ index => $ value ) { if ( ! in_array ( $ index , $ indexes ) ) { $ outputArray [ ] = $ value ; } } } else { foreach ( $ indexes as $ index ) { if ( isset ( $ inputArray [ $ index ] ) ) { unset ( $ inputArray [ $ index ] ) ; } } $ outputArray = $ inputArray ; } return $ outputArray ; }
Removes the specified indexes from the input array before returning it.
Removes the specified indexes from the input array before returning it .
# Was going to use array_filter here but realized user may want  # 'false' values.