Skip to content

Instantly share code, notes, and snippets.

@esedic
Created June 7, 2014 08:18
Show Gist options
  • Save esedic/ee6f406ba1a4aca702fa to your computer and use it in GitHub Desktop.
Save esedic/ee6f406ba1a4aca702fa to your computer and use it in GitHub Desktop.
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>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment