why does
<?php
$text_counter=0;
?>
{embed="global/header" loc="homepage"}
{exp:channel:entries channel="homepage_layout" status="open" limit="8" }
{media_type}
{if media_type == "text"}
<?php
$text_counter++;
echo $text_counter;
?>
{/if}
{/exp:channel:entries}has this output
text 1
image
text 3
text 4
image
and not
text 1
image
text 2
text 3
image
or even (if php decides to ignore the EE statements)
text 1
image 2
text 3
text 4
image 5
anyone?