Change css class of loop values in PHP
<p>I have the following </p>

<pre><code>echo "&lt;span&gt;".apply_filters(" $value\n", $value)."&lt;/span&gt;";
</code></pre>

<p>that outputs </p>

<pre><code>&lt;span&gt;Value&lt;/span&gt; &lt;span&gt;value 2&lt;/span&gt; &lt;span&gt;value 3&lt;/span&gt;
</code></pre>

<p>I want to append a 1 to each span outputted, so </p>

<pre><code>&lt;span class="span-1"&gt;Value&lt;/span&gt; &lt;span"span-2"&gt;value 2&lt;/span&gt; &lt;span"span-3"&gt;value 3&lt;/span&gt;
</code></pre>

<p>How would I go about doing this or when can I find information/correct terminology on the issue? </p>

<p>Thanks</p>

<hr>

<pre><code>foreach ( (array) $keys as $key ) {
    $keyt = trim($key);
    if ( '_' == $keyt{0} || 'pricing' == $keyt || 'vehicleType' == $keyt || 'coverageRegion' == $keyt || 'locationType' == $keyt )
    continue;
    $values = array_map('trim', get_post_custom_values($key));
    $value = implode($values,', '); 
    echo "&lt;span class='srch-val'&gt;".apply_filters(" $value\n", $value)."&lt;/span&gt;";
}
</code></pre>
