I don't know how much slower/faster this would be but an easy solution to this would be (using a simple example):
$key = array_search(6, $array);
$array[$key] = 12;
I don't know how much slower/faster this would be but an easy solution to this would be (using a simple example):
$key = array_search(6, $array);
$array[$key] = 12;