vangilsweb Posted August 22, 2011 Share Posted August 22, 2011 Is there an alternative for the following function? <?php if ($products->count()>0):?> This function causes long loading time. Is there an alternative, for we only want to know if $products contains products, not the number of products. Link to comment https://forums.phpfreaks.com/topic/245418-count-function/ Share on other sites More sharing options...
vangilsweb Posted August 22, 2011 Author Share Posted August 22, 2011 solved it like this: instead of: <?php if ($products->count()>0):?> [i]code...[/i] use this: <?php if (!$products->count()):?> [i]no code...[/i] <?php else : ?> [i]code...[/i] Link to comment https://forums.phpfreaks.com/topic/245418-count-function/#findComment-1260473 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.