How to remove the specified value from the php array
This article mainly introduces how to remove the specified value of the php array, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.
1. Delete specific elements in the array using the foreach and unset () functions.
2. Delete a specific value in the array by using the array_flip () function and the unset () function.
3. Delete the median value of the array by using the array_search () and unset () functions.
Example
Foreach ($array as $k = > $v) {if ($v = = 'day') {unset ($array [$k]):}} Thank you for reading this article carefully. I hope the article "how to remove the specified value of php Array" shared by the editor will be helpful to you. At the same time, I hope you will support us, pay attention to the industry information channel, and more related knowledge is waiting for you to learn!