Jump to content

foreach loop - adding a string to all items apart from the last 4


terrid25

Recommended Posts

Hi

 

I have an array of items that I am currently displaying a foreach loop

 

What I'm looking to do, is add a string, to all of items, a part from the last 4:

 

foreach ($pager->getResults() as $items => $item)
{
echo $item->getName(); 
//need to add a string to this for the all but the last 4
}

 

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.