I find it difficult to limit the number of links displayed: <?php $websites = $data->select ( "Website_Tag" , "*", array ( "TagID" => intval ( $tag_web["TagID"] ) ) ); if ( ! empty ( $websites ) ) foreach ( $websites as $website ) : $web_detail = $data->select ( "Website" , "*" , array ( "WebsiteID" => $website["WebsiteID"] ) ); $web_detail = $web_detail[0]; ?> <a href="<?php echo base_url.get_sef_url ( $website["WebsiteID"] , "Website" ) ?>/"><?php echo $web_detail["WebsiteName"] ?></a> <?php endforeach; ?> PHP: What can I do to limit the generated links?
Just add before the foreach the following line $counter = 0; PHP: Add just next to the foreach the following line $counter++; if ($counter > 5) break; PHP: you can change the 5 to the number you need.