Skip to content

Instantly share code, notes, and snippets.

@aurelkurtula
Created August 21, 2013 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurelkurtula/6294201 to your computer and use it in GitHub Desktop.
Save aurelkurtula/6294201 to your computer and use it in GitHub Desktop.
php: loop
<?php
$tags = array();
while($row = mysqli_fetch_array($result))
{
$row = $row['tags'];
$array = explode(',', $row);
foreach($array as $val) {
array_push($tags, $val);
}
}
$tags = array_filter(array_unique($tags)) ;
foreach($tags as $val) {
echo '<li><a href="?tag='.$val.'">'. $val . '</a></li>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment