How do I remove and view the last element of an array?
<?php
$values = array("I","Like","Sentences","That","Don't","Finish");
$discard = array_pop($values);
echo "Bye bye to $discard...\n\n";
$sentence = implode(" ",$values);
echo "$sentence";
?>
Which gives us the following output:
Bye bye to Finish...
I Like Sentences That Don't
More arrays PHP Questions
I want to invert my array, can I do this?How do I remove an element from an array without changing the index values for the rest of the array?
How do I write my own sort function?
How can I display values in a two dimensional array?
How can I create an array of the letters of the alphabet?