So I have a JSON document I\'m storing in CouchDB. Here\'s the important part of it:
\"games\": { \"creator\": [ \"cf86d68b24c1bbf22702356572027642\",
I fixed it like this:
unset($user->games->creator[1]); $user->games->creator = array_values($user->games->creator);
Instead of using unset, use array_splice. This will automatically adjust the array indexes:
unset
array_splice
array_splice($user->games->creator, 1, 1);