I have an array of integers in php and what I'd like to do is check if the before the last element is equal to 'x'. I've tried this:
if(prev(end($array)) == $x)
But it returns an error Warning: prev() expects parameter 1 to be array, string given given the fact end returns the last element instead of a pointer. Any idea on this one?