If I have an array with say 100 elements.. how can I echo/show the top 5 only for example?

Thank you :)

Accepted Answer

for ($index=0; $index < min(5, count($arr)); $index++)
{
    echo $arr[$index];
}
Written by Svisstack
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki