Code: Select all
[]AAA
[]aaa
[]BBB
[]bbb
[]CCC
[]ccc
Code: Select all
[]AAA
[]BBB
[]CCC
Moderator: General Moderators
Code: Select all
[]AAA
[]aaa
[]BBB
[]bbb
[]CCC
[]ccc
Code: Select all
[]AAA
[]BBB
[]CCC
Code: Select all
[]AaA
[]aAa
[]BBb
[]bbB
[]cCC
[]ccC
Code: Select all
[]AaA
[]BBb
[]cCC
Code: Select all
$words = array_unique($words);
$minimum_word_length = 4;
$small_words = array_map('strtolower',$words);
$small_words = array_unique($small_words);
foreach ($small_words as $key=>$small_word)
{
if (strlen($small_word)<$minimum_word_length) continue;
if (array_key_exists($key, $words))
{
$unique_words[] = $words[$key];
}
}
$words = $unique_words;
Code: Select all
$testArray = array('AaA',
'AAA',
'aaa',
'aAa',
'BBB',
'bbB',
'Bbb',
'Ccc',
'CCC'
);
function arrayCaseFilter($item, $key) {
global $testArray;
foreach($testArray as $filterKey => $filterEntry) {
if ((strtoupper($item) == strtoupper($filterEntry)) && ($key != $filterKey)) {
unset($testArray[$filterKey]);
}
}
}
array_walk($testArray,'arrayCaseFilter');
print_r($testArray);
Code: Select all
function arrayCaseFilter($item, $key, &$filterArray) {
foreach($filterArray as $filterKey => $filterEntry) {
if ((strtoupper($item) == strtoupper($filterEntry)) && ($key != $filterKey)) {
unset($filterArray[$filterKey]);
}
}
}
array_walk($testArray,'arrayCaseFilter',$testArray);
Code: Select all
$buffer = array_unique(array_map('strtolower',$words));
$words = array_intersect_key ($words,$buffer);
Code: Select all
$filterArray=$testArray;
array_walk($testArray,'arrayCaseFilter',$filterArray);
print_r($filterArray);