Tuesday, April 9, 2013

How to get last element of an array?

Answer:
To get the last element use the end()
<?php

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

Share/Bookmark

No comments:

Post a Comment