Php Check If Last Element Of Array In Javascript W3schools