hey there i have this array:
array(1) {
[\"dump\"]=>
string(38) \"[\"24.0\",24.1,24.2,24.3,24.4,24.5,24.6]\"
}
my question:
For first element: current($arrayname);
For last element: end($arrayname);
current(): The current() function returns the value of the current element in an array. Every array has an internal pointer to its "current" element, which is initialized to the first element inserted into the array.
end(): The end() function moves the internal pointer to, and outputs, the last element in the array. Related methods: current() - returns the value of the current element in an array
$array = array(24.0,24.1,24.2,24.3,24.4,24.5,24.6);
$first = current($array);
$last = end($array);
echo 'First Element: '.$first.' :: Last Element:'.$last;
Output result:
First Element: 24 :: Last Element:24.6