<?php $results = get_results();foreach($results as $foo) { if($foo > 10) $stuff[]++; }template->assign('stuff', $stuff);