So I got a database with keywords. The keywords is setup like so: "PHP, HTML, CSS".
I want to split the keywords up, and paste them into a select tag.
I wrote the following code which does that:
$query10 = "SELECT * FROM projects";
if($result=mysqli_query($conn,$query10))
while ($row=mysqli_fetch_assoc($result)) {
$mark = explode(",", $row['projectKeywords']);
foreach ($mark as $out) {
?> <option><?php echo $out ?></option> <?php
}
}
?>
It works fine, but I get duplicates. How do I delete does duplicates. I have tried with array_unique, but I couldn't figure it out.
-Matteo