I have a field that has picture tags in it, so some of them are the same as other tag rows, however I don't want to repeat all the tags over and over. So I want it to check and see if that tag was already echoed and if it was then don't echo it again.
So I tried storing them in an array then searching the array for that value, however it didn't work at all... it is continuing to echo them regardless of being in the array or not. Any ideas?
Also, the field they are pulling from is like this: these are, some, of my, tags, for, my, picture.
<?
require('../dbconnect.php');
$sql = "SELECT * FROM my_table";
$rs = mysql_query($sql);
while($data = mysql_fetch_assoc($rs)) {
$info = stripslashes($data['tags']);
$entry = explode(",", $info);
$total = count($entry);
$check = array();
for($i=0; $i< $total; $i++){
$current = strtolower(trim($entry[$i]));
$current_show = ucwords($current);
if(!in_array($current, $check)){
echo "'".$current_show."',";
$check[$i.$current] = $current;
}
}
}
?>