I really hate using count to find the last index number of an array because I always have to -1 it. Is there another way?
I don't think so, using the last index could cause issues if the array was not created with all the keys.
If you want the last key of an array regardless of how it is indexed or what sequence (if any) the keys are in:
end($array); $lastIndex = key($array);