Concept

How does unset() remove elements from a PHP array?

ComputerScienceOne / Removing Elements

"You can remove elements from an array using the unset() function. This function only removes the element from the array, it does not shift other elements down to fill in the unused index.\n\n$arr = array(10, 20, 30);\n\nunset($arr[1]);\n\nprint_r($arr);\n\nThis example would result in the following.\n\nArray ( [0] => 10 [2] => 30 )\n\nFurther, you can use unset() to destroy all elements in the array."

Related Ideas

How does unset() remove elements from a PHP array? | ComputerScienceOne | Bifalgorithm | Bifalgorithm