Php Remove Last Element Of Array Js Slice Array Method