Php Remove Last Element Of Array Javascript Length Method In Sql