I would like to remove a certain value based on the value. Example in this situation, I would like to remove Tom
from the array, then the next data will continue with the number that is previously used by Tom
.
Here's my example:
$array = array(0 => "Emily", 1 => "Tom", 2 => "Peter");
if ($k = array_search($csR, $array)!==false)
unset($array[$k]);
The outcome should be:
array(0 => "Emily", 1 => "Peter");