Answer the question
In order to leave comments, you need to log in
How to remove duplicates?
There is such a code, it displays the latest tags from the site's articles.
$result = $mysqli->query("SELECT * FROM tags LIMIT 5");
while($row = $result->fetch_array()) {
$pole = explode(',', $row['name']);
$i = 0;
foreach($pole as $word){
$word = trim($word);
if($word){
echo "<a href=\"#\">" . $word . "</a>";
$i++;
}
}
}
Answer the question
In order to leave comments, you need to log in
php.net/manual/en/function.array-unique.php$pole=array_unique($pole);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question