how to remove last element from php array

Solutions on MaxInterview for how to remove last element from php array by the best coders in the world

showing results for - "how to remove last element from php array"
Thiago
19 Jun 2020
1if(empty($transport[count($transport)-1])) {
2    unset($transport[count($transport)-1]);
3}