Array_keys() and array_values() are very closely related functions: the former returns an array of all the keys in an array, and the latter returns an array of all the values in an array. For example, consider you had an array with user IDs as keys and usernames as values, you could use array_keys() to generate an array where the values were the keys. Try this following example out:
After execution, $userids will be an array of user IDs, as you will see when the var_dump() function outputs $userids to the screen.
There are two other parameters that can be passed to array_keys(), which are, in order, a value to match, and whether to perform strict matching. These two are there to allow you to filter your array keys - if you specify "tennis", for example, then the only keys that array_keys() will return are the ones that have the value "tennis". By default this is done by checking each key's value with the == operator (is equal to), however if you specify 1 as the third parameter the check will be done with === (is identical to).
This time the $userids array will only contain one element, with a value of 923, as the script filters by value "TelRev".
Moving on, the usefulness of the array_values() function may at first not be apparent - after all, why would you want the values of a new array to be set to the values of an old array? This all boils down to how numerical arrays are indexed. If you use the array operator  to assign variables to an array, PHP will use 0, 1, 2, etc as the keys. If you then sort the array using a function such as asort(), which keeps the keys intact, the array's keys will be out of order because asort() sorts by value, not by key.
However, using the array_values() function makes PHP create a new array where the indexes are recreated and the values are copied from the old array, essentially making it renumber the array elements.
This next script demonstrates array_values() in action:
The first var_dump() prints the array out in its original ordering. The second prints it out ordered by the values - the keys will be jumbled up, however. The final call to var_dump() uses array_values() to create a new array, and you should see that the jumbled up keys have been re-ordered. Here's how it looked on my screen:
You should use array_values() when you want to re-order an array's indexes either because they are jumbled up or because they have holes in, but you can also use it to convert an associative array with strings as the indexes to a plain numerical array.