PHP Classes

File: test/85_array_last.php

Recommend this page to a friend!
  Classes of ASCOOS CMS   PHP Backwards Compatibility Library   test/85_array_last.php   Download  
File: test/85_array_last.php
Role: Example script
Content type: text/plain
Description: Returns the last value of a given array.
Class: PHP Backwards Compatibility Library
Functions of newer PHP versions for older versions
Author: By
Last change:
Date: 1 month ago
Size: 253 bytes
 

Contents

Class file image Download
<?php

array_last
([1, 2, 3]); // 3
array_last([2, 3]); // 3
array_last(['a' => 2, 'b' => 1]); // 1
array_last([2, 3, null]); // null
array_last([]); // null
array_last([2, 3, $obj]); // $obj
array_last([1]); // 1
array_last([true]); // true
?>