Php uses unset () to delete a unit (key) in an array. Php uses the unset () method to delete a cell (key) in an array. This document describes how php uses unset () to delete a cell (key) in an array. The unset array is used by php to delete a cell (key) in an array.
This example describes how php uses unset () to delete a cell (key) in an array. Share it with you for your reference. The specific analysis is as follows:
Unset can delete a variable or a unit in the array. However, it should be noted that the array will not be re-indexed.
Example:
<? Php $ arr = array ("Chaoyang district", "Haidian District", "Xicheng District", "Dongcheng District", "Fengtai district"); unset ($ arr [3]); echo""; Print_r ($ arr);?>
The output result is as follows:
Array ([0] => Chaoyang district [1] => Haidian District [2] => Xicheng District [4] => Fengtai District)
I hope this article will help you with php programming.
The unset array example describes how php uses unset () to delete a unit (key) in an array. Share it with you...