Using end in PHP

end –  Set the internal pointer of an array to its last element

Description

mixed end ( array array)

end() advances array’s internal pointer to the last element, and returns the value from the last element.

Example 1. A simple end() example

<?php

$fruits = array(‘apple’, ‘banana’, ‘cranberry’);

echo end($fruits); // cranberry

?>

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • YahooMyWeb
  • Yigg

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)