Answers for "php array first and last element"

PHP
23

How to Get the last element of an array in PHP – end()

<?php

$source_array = ['key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'];

$result = end($source_array);

echo "Last element: ".$result;

?>
Posted by: Guest on August-05-2020

Code answers related to "php array first and last element"

Browse Popular Code Answers by Language