<?php

/**
 * Total itens
 *
 * Com base no número recebido, devolve uma indicação
 * humanamente legível sobre o total de itens.
 *
 * @param integer $i Número a analisar .
 * return $string $html HTML pronto a utilizar.
 */
function totalItens ($i=0) {

  $html = ' (nenhum)';

  if ($i >= 1) {

    $html = ($i == 1) ? ' (1 item)' : ' ('.$i.' itens)';
  }

  return $html;
}

echo totalItens(3);