Improving on what @svisstack has submitted as a solution for the issue:
for ($index=0; $index < min(5, count($arr)); $index++) { print_r ($arr[$index]); //change echo to print_r }