Set array pointer to a specific key or value in PHP
What PHP lacks is the ability to set the array pointer to an arbitrary key or value. There are ways to move forward and backward in the array but not a dedicated function to set the internal pointer to a specific key. Fortunately we can make it work, but it’s pretty archiac. We’ll need to loop through the array and look for what we want.