Hi
I got an array and want to take away the last part from the array:
$action = split('[)]', $temp); $end = end($action); $slice = array_slice($action, $end); foreach ($action as $a) { echo "$a<br>"; }
This is what I try with but I cant get it to work, any ideas?
Thanks Rillo
instead of actually physically getting rid of the last element, why not just set it null?
$array = split('[)]', $temp);
$no_of_elements = count($array) $array[($no_of_elements - 1)] = "";
foreach ($array as $element) { echo "$element<br>"; }
<? $action = split('[)]', $temp); array_pop ($action);
foreach ($action as $a) { echo "$a<br>"; } ?>