Skip to content

PHP code snippet – How to remove last element from array?

if(empty($transport[count($transport)-1])) {
    unset($transport[count($transport)-1]);
}
See also  Python code snippet - How to check if string contains only numbers?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.