Reindex an Array in PHP

Occasionally, you may need to arbitrarily reindex an array of data in PHP. WordPress doesn’t really provide a function for doing this, so I put together this code snippet.