I have this code that I want to insert a div clear class the it reaches the 5th column:
\">
<
It is because you have not declared your variable. If you add $count = 0;
to the top of your PHP file the error will go away as you have declared the variable.
You should also note that this has nothing to do with Zend Framework.
It is better to do that with CSS and not with markup or server side scripting. Let me give you an example:
.grid:nth-child(5n+5), .grid.fifth-child { clear: both; }
It's not supported in every browser so you can use jQuery to fix that:
$('.grid:nth-child(5n+5)').addClass('fifth-child');