Loop through array and increase values
<?php $count = 1; $values = array("1","2","3"); echo "<ul>"; foreach($values as $value){ echo "<li data-id=\"id-".$count."\" data-type=\"".$value['class']."\">test</li>\n"; $count++; } echo "</ul>";