Sunday, 13 January 2013

How to get last element of an array?

Answer:
To get the last element use the end()



$arr = array('php', 'online', 'tutorials');
echo end($arr); // tutorials

?>

No comments:

Post a Comment