SyntaxFix
Write A Post
Hire A Developer
Questions
One more possible solution...
$last_element = array_reverse( $array )[0];