Wenn www.combinewords.com mal wieder nicht geht, kann man sich lokal hiermit einen Ersatz basteln. Mag nicht das eleganteste PHP sein (bin noch kein Crack in dieser Sprache), aber es genügt und funktioniert ![]()
Wer das Online-Tool nicht kennt, es kombiniert Wortlisten in jeder möglichen Kombination, also z.B. zwei Keyword-Sets wie:
set1wort1
set1wort2
mit
set2phrase1
set2phrase2
set2phrase3
Ergebnis:
set1wort1 set2phrase1
set1wort1 set2phrase2
set1wort1 set2phrase3
set1wort2 set2phrase1
set1wort2 set2phrase2
set1wort2 set2phrase3
LG,
Olli
//Combine words function
function getCombined($keywords,$keywords2){
$combined = explode("\n", $keywords);
$combined2 = explode("\n", $keywords2);
$maxTerms = (sizeOf($combined)) * (sizeOf($combined2));
$j = 1;
while(sizeOf($combined) > 0){
while(sizeOf($combined2) > 0){
$combinedsingle = $combined[0];
$gesamt_array[0][$j] = $combinedsingle." ".array_shift($combined2);
$j++;
}
$combined2 = explode("\n", $keywords2);
array_shift($combined);
}
for($i=1; $i <= $maxTerms; $i++) {
echo $gesamt_array[0][$i]."<br />";
}
}
//Call-example:
$tempinputfield=$_POST['inputfield'];
$tempinputfield2=$_POST['inputfield2'];
echo getCombined($tempinputfield,$tempinputfield3);
Tags: beispiel, combine, combinewords, function, funktion, kombinieren, php, programmierung, words, wörter




