Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to get last array element in php

<?php

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

$result = end($source_array);

echo "Last element: ".$result;

?>
Source by www.gtechhub.com #
 
PREVIOUS NEXT
Tagged: #array #element #php
ADD COMMENT
Topic
Name
4+5 =