well ive built this
Code: Select all
<?php
include("config.php");
// Create array here
$themelist = array("");
$dir = "../demo/themes/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(file_exists("../demo/themes/$file/theme.php")){
array_push($themelist, $file); // Add value to array
}
}
closedir($dh);
}
}
$q = "SELECT * FROM nuke_theme_preview";
$result = mysql_query($q) or die ('Something is wrong with query: ' . $q . '<br>'. mysql_error());
while ($row = mysql_fetch_assoc($result))
{
array_push($themelist, $row['t_title']); // Add value to array
}
print_r ($themelist);
?>
which outputs
Array ( [0] => [1] => 3D-Fantasy [2] => Anagram [3] => DeepBlue [4] => ExtraLite [5] => Kaput [6] => Karate [7] => Milo [8] => NukeNews [9] => Odyssey [10] => Sand_Journey [11] => Slash [12] => SlashOcean [13] => Sunset [14] => Traditional [15] => 3D-Fantasy [16] => Anagram [17] => DeepBlue [18] => ExtraLite [19] => Kaput )
but if you notice there are diplicate entries, and i dont either of the duplicate's. In other words i want the array to look like this:
Array ( [0] => [1] => Milo [2] => NukeNews [3] => Odyssey [4] => Sand_Journey [5] => Slash [6] => SlashOcean [7] => Sunset [8] => Traditional )
using array_unique () will out put this:
Array ( [0] => [1] => 3D-Fantasy [2] => Anagram [3] => DeepBlue [4] => ExtraLite [5] => Kaput [6] => Karate [7] => Milo [8] => NukeNews [9] => Odyssey [10] => Sand_Journey [11] => Slash [12] => SlashOcean [13] => Sunset [14] => Traditional )
which is close, but still not what i want.
at php.net the first user contributed note is a function that removes duplicate entries in regard to a specific element. i dont want to remove the duplicates with regard to a specific element, i just want to remove all duplicates period.
Maybe i could get a little more help this time.
Thank You.