$count=1; while ($count <= $totalcats[0]) { $xc="item$nr"; $xv = "itid$nr"; if(!isset($post[$xv])) { $nr++; continue; }