Count Function for dynamic purpose
<p>I am trying to create a generalized function that will add a number to each of my divs to make them unique.  I so far have the following code as a general idea but I would like to know what the best option would be for my purpose as I am going to implement this into a system that produces the HTML dynamically.</p>

<pre><code>&lt;?php
count($num);
?&gt;

&lt;div id ="service"&gt;
    &lt;div class="image&lt;?php echo $num ?&gt;"&gt;&lt;img src="http://placekitten.com/202/125" alt=""&gt;&lt;/div&gt;
    &lt;div class="title"&gt;Pussy Cat&lt;/div&gt;
    &lt;div class="content"&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ante elit, lobortis at fringilla vitae, bibendum at enim. Vivamus porttitor urna eget odio imperdiet accumsan sed ut mauris. Nunc magna dui, ultricies nec suscipit at, venenatis eget sapien. Aliquam a nunc laoreet massa aliquam condimentum. Phasellus euismod condimentum congue. Mauris facilisis sem a magna dapibus eu ultricies ligula elementum. Sed fermentum&lt;/div&gt;
&lt;/div&gt;

&lt;div id ="service"&gt;
    &lt;div class="image&lt;?php echo $num ?&gt;"&gt;&lt;img src="http://placekitten.com/202/125" alt=""&gt;&lt;/div&gt;
    &lt;div class="title"&gt;Pussy Cat&lt;/div&gt;
    &lt;div class="content"&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ante elit, lobortis at fringilla vitae, bibendum at enim. Vivamus porttitor urna eget odio imperdiet accumsan sed ut mauris. Nunc magna dui, ultricies nec suscipit at, venenatis eget sapien. Aliquam a nunc laoreet massa aliquam condimentum. Phasellus euismod condimentum congue. Mauris facilisis sem a magna dapibus eu ultricies ligula elementum. Sed fermentum&lt;/div&gt;
&lt;/div&gt;
</code></pre>
