PHP清空陣列函數
Temperature: 0 °C
unset(arrar)
將整個陣列清空,但之後如果再加入元素,其 index 是往上累加的,而非從 0 開始。
array_values($arr)
使用 unset() 去掉陣列的元素後 index 可能會很混亂,此時可用此函數
https://innstory.com/story-PHP清空陣列函數-1560
PHP