Danke an Alle; ich werde jetzt erstmal die ganzen Anregungen versuchen zu verarbeiten, mental und auch praktisch
Mal sehen, wo mich das hinfuehrt.
Mal sehen, wo mich das hinfuehrt.
<tr bgcolor="#ebebeb"> <td align="left" valign="top"><font color="#33066" size="+0"> Lesson 9</td> <td align="left" valign="top"><font color="#33066" size="+0"><?PHP foreach ($verbs_L9_unique as $key => $value) {echo $value; echo "<br />";};?></td> <td align="left" valign="top"><font color="#33066" size="+0"><?PHP foreach ($verbs_L9_new_ones as $key => $value) {echo $value; echo "<br />";};?></td> <td align="left" valign="top"><font color="#33066" size="+0"><?PHP foreach ($verbs_L9_so_far_undoub as $key => $value) {echo $value; echo "<br />";};?></td> </tr>
[ $verbs_L9_unique, $verbs_L9_new_ones, $verbs_L9_so_far_undoub ],
<!DOCTYPE html> <html> <head> <title>Vocabulary file</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <?PHP #first we get all the data on vocab occurrence from the feeder file include "vocab_in_arrays_feederfile_verbs.php"; ##then we remove the duplicates out of the arrays using the unique function ##and sort them alphabetically using asort $verbs_L1_unique = array_unique($verbs_L1_occurr); asort($verbs_L1_unique); $verbs_L2_unique = array_unique($verbs_L2_occurr); asort($verbs_L2_unique); $verbs_L3_unique = array_unique($verbs_L3_occurr); asort($verbs_L3_unique); $verbs_L4_unique = array_unique($verbs_L4_occurr); asort($verbs_L4_unique); $verbs_L5_unique = array_unique($verbs_L5_occurr); asort($verbs_L5_unique); $verbs_L6_unique = array_unique($verbs_L6_occurr); asort($verbs_L6_unique); $verbs_L7_unique = array_unique($verbs_L7_occurr); asort($verbs_L7_unique); $verbs_L8_unique = array_unique($verbs_L8_occurr); asort($verbs_L8_unique); $verbs_L9_unique = array_unique($verbs_L9_occurr); asort($verbs_L9_unique); $verbs_L10_unique = array_unique($verbs_L10_occurr); asort($verbs_L10_unique); $verbs_L11_unique = array_unique($verbs_L11_occurr); asort($verbs_L11_unique); $verbs_L12_unique = array_unique($verbs_L12_occurr); asort($verbs_L12_unique); $verbs_L13_unique = array_unique($verbs_L13_occurr); asort($verbs_L13_unique); $verbs_L14_unique = array_unique($verbs_L14_occurr); asort($verbs_L14_unique); $verbs_L15_unique = array_unique($verbs_L15_occurr); asort($verbs_L15_unique); $verbs_L16_unique = array_unique($verbs_L16_occurr); asort($verbs_L16_unique); $verbs_L17_unique = array_unique($verbs_L17_occurr); asort($verbs_L17_unique); $verbs_L18_unique = array_unique($verbs_L18_occurr); asort($verbs_L18_unique); $verbs_L19_unique = array_unique($verbs_L19_occurr); asort($verbs_L19_unique); $verbs_L20_unique = array_unique($verbs_L20_occurr); asort($verbs_L20_unique); #The above gives the list of used verbs per lesson #now we look for piled up vocab #here we note all verbs piled up so far uncleaned (means with doubles) $verbs_L1_so_far_unclean = $verbs_L1_unique; $verbs_L2_so_far_unclean = array_merge($verbs_L2_unique, $verbs_L1_so_far_unclean); $verbs_L3_so_far_unclean = array_merge($verbs_L3_unique, $verbs_L2_so_far_unclean); $verbs_L4_so_far_unclean = array_merge($verbs_L4_unique, $verbs_L3_so_far_unclean); $verbs_L5_so_far_unclean = array_merge($verbs_L5_unique, $verbs_L4_so_far_unclean); $verbs_L6_so_far_unclean = array_merge($verbs_L6_unique, $verbs_L5_so_far_unclean); $verbs_L7_so_far_unclean = array_merge($verbs_L7_unique, $verbs_L5_so_far_unclean); $verbs_L8_so_far_unclean = array_merge($verbs_L8_unique, $verbs_L7_so_far_unclean); $verbs_L9_so_far_unclean = array_merge($verbs_L9_unique, $verbs_L8_so_far_unclean); $verbs_L10_so_far_unclean = array_merge($verbs_L10_unique, $verbs_L9_so_far_unclean); $verbs_L11_so_far_unclean = array_merge($verbs_L11_unique, $verbs_L10_so_far_unclean); $verbs_L12_so_far_unclean = array_merge($verbs_L12_unique, $verbs_L11_so_far_unclean); $verbs_L13_so_far_unclean = array_merge($verbs_L13_unique, $verbs_L12_so_far_unclean); $verbs_L14_so_far_unclean = array_merge($verbs_L14_unique, $verbs_L13_so_far_unclean); $verbs_L15_so_far_unclean = array_merge($verbs_L15_unique, $verbs_L14_so_far_unclean); $verbs_L16_so_far_unclean = array_merge($verbs_L16_unique, $verbs_L15_so_far_unclean); $verbs_L17_so_far_unclean = array_merge($verbs_L17_unique, $verbs_L15_so_far_unclean); $verbs_L18_so_far_unclean = array_merge($verbs_L18_unique, $verbs_L17_so_far_unclean); $verbs_L19_so_far_unclean = array_merge($verbs_L19_unique, $verbs_L18_so_far_unclean); $verbs_L20_so_far_unclean = array_merge($verbs_L20_unique, $verbs_L19_so_far_unclean); #we take the doubles out here and sort alphabetically $verbs_L1_so_far_undoub = array_unique($verbs_L1_so_far_unclean); asort($verbs_L1_so_far_undoub); $verbs_L2_so_far_undoub = array_unique($verbs_L2_so_far_unclean); asort($verbs_L2_so_far_undoub); $verbs_L3_so_far_undoub = array_unique($verbs_L3_so_far_unclean); asort($verbs_L3_so_far_undoub); $verbs_L4_so_far_undoub = array_unique($verbs_L4_so_far_unclean); asort($verbs_L4_so_far_undoub); $verbs_L5_so_far_undoub = array_unique($verbs_L5_so_far_unclean); asort($verbs_L5_so_far_undoub); $verbs_L6_so_far_undoub = array_unique($verbs_L6_so_far_unclean); asort($verbs_L6_so_far_undoub); $verbs_L7_so_far_undoub = array_unique($verbs_L7_so_far_unclean); asort($verbs_L7_so_far_undoub); $verbs_L8_so_far_undoub = array_unique($verbs_L8_so_far_unclean); asort($verbs_L8_so_far_undoub); $verbs_L9_so_far_undoub = array_unique($verbs_L9_so_far_unclean); asort($verbs_L9_so_far_undoub); $verbs_L10_so_far_undoub = array_unique($verbs_L10_so_far_unclean); asort($verbs_L10_so_far_undoub); $verbs_L11_so_far_undoub = array_unique($verbs_L11_so_far_unclean); asort($verbs_L11_so_far_undoub); $verbs_L12_so_far_undoub = array_unique($verbs_L12_so_far_unclean); asort($verbs_L12_so_far_undoub); $verbs_L13_so_far_undoub = array_unique($verbs_L13_so_far_unclean); asort($verbs_L13_so_far_undoub); $verbs_L14_so_far_undoub = array_unique($verbs_L14_so_far_unclean); asort($verbs_L14_so_far_undoub); $verbs_L15_so_far_undoub = array_unique($verbs_L15_so_far_unclean); asort($verbs_L15_so_far_undoub); $verbs_L16_so_far_undoub = array_unique($verbs_L16_so_far_unclean); asort($verbs_L16_so_far_undoub); $verbs_L17_so_far_undoub = array_unique($verbs_L17_so_far_unclean); asort($verbs_L17_so_far_undoub); $verbs_L18_so_far_undoub = array_unique($verbs_L18_so_far_unclean); asort($verbs_L18_so_far_undoub); $verbs_L19_so_far_undoub = array_unique($verbs_L19_so_far_unclean); asort($verbs_L19_so_far_undoub); $verbs_L20_so_far_undoub = array_unique($verbs_L20_so_far_unclean); asort($verbs_L20_so_far_undoub); ####After this we find out which vocab per lesson is new $verbs_L1_new_ones = $verbs_L1_unique; $verbs_L2_new_ones = array_diff($verbs_L2_unique, $verbs_L1_so_far_undoub); $verbs_L3_new_ones = array_diff($verbs_L3_unique, $verbs_L2_so_far_undoub); $verbs_L4_new_ones = array_diff($verbs_L4_unique, $verbs_L3_so_far_undoub); $verbs_L5_new_ones = array_diff($verbs_L5_unique, $verbs_L4_so_far_undoub); $verbs_L6_new_ones = array_diff($verbs_L6_unique, $verbs_L5_so_far_undoub); $verbs_L7_new_ones = array_diff($verbs_L7_unique, $verbs_L6_so_far_undoub); $verbs_L8_new_ones = array_diff($verbs_L8_unique, $verbs_L7_so_far_undoub); $verbs_L9_new_ones = array_diff($verbs_L9_unique, $verbs_L8_so_far_undoub); $verbs_L10_new_ones = array_diff($verbs_L10_unique, $verbs_L9_so_far_undoub); $verbs_L11_new_ones = array_diff($verbs_L11_unique, $verbs_L10_so_far_undoub); $verbs_L12_new_ones = array_diff($verbs_L12_unique, $verbs_L11_so_far_undoub); $verbs_L13_new_ones = array_diff($verbs_L13_unique, $verbs_L12_so_far_undoub); $verbs_L14_new_ones = array_diff($verbs_L14_unique, $verbs_L13_so_far_undoub); $verbs_L15_new_ones = array_diff($verbs_L15_unique, $verbs_L14_so_far_undoub); $verbs_L16_new_ones = array_diff($verbs_L16_unique, $verbs_L15_so_far_undoub); $verbs_L17_new_ones = array_diff($verbs_L17_unique, $verbs_L16_so_far_undoub); $verbs_L18_new_ones = array_diff($verbs_L18_unique, $verbs_L17_so_far_undoub); $verbs_L19_new_ones = array_diff($verbs_L19_unique, $verbs_L18_so_far_undoub); $verbs_L20_new_ones = array_diff($verbs_L20_unique, $verbs_L19_so_far_undoub); ?> <a href="vocab_in_arrays_verbs.php">List of verbs</a> <a href="vocab_in_arrays_adjectives.php">List of adjectives</a> <a href="vocab_in_arrays_nouns.php">List of nouns</a> <a href="vocab_in_arrays_others.php">List of other vocab</a> <a href="vocab_in_arrays_chunks.php">List of chunks</a><br /> <br /> <!--now we print them as a table--> <?PHP $data = [ #hier hab ich eure Ideen benutzt [ $verbs_L1_unique, $verbs_L1_new_ones, $verbs_L1_so_far_undoub ], [ $verbs_L2_unique, $verbs_L2_new_ones, $verbs_L2_so_far_undoub ], [ $verbs_L3_unique, $verbs_L3_new_ones, $verbs_L3_so_far_undoub ], [ $verbs_L4_unique, $verbs_L4_new_ones, $verbs_L4_so_far_undoub ], [ $verbs_L5_unique, $verbs_L5_new_ones, $verbs_L5_so_far_undoub ], [ $verbs_L6_unique, $verbs_L6_new_ones, $verbs_L6_so_far_undoub ], [ $verbs_L7_unique, $verbs_L7_new_ones, $verbs_L7_so_far_undoub ], [ $verbs_L8_unique, $verbs_L8_new_ones, $verbs_L8_so_far_undoub ], [ $verbs_L9_unique, $verbs_L9_new_ones, $verbs_L9_so_far_undoub ], [ $verbs_L10_unique, $verbs_L10_new_ones, $verbs_L10_so_far_undoub ], [ $verbs_L11_unique, $verbs_L11_new_ones, $verbs_L11_so_far_undoub ], [ $verbs_L12_unique, $verbs_L12_new_ones, $verbs_L12_so_far_undoub ], [ $verbs_L13_unique, $verbs_L13_new_ones, $verbs_L13_so_far_undoub ], [ $verbs_L14_unique, $verbs_L14_new_ones, $verbs_L14_so_far_undoub ], [ $verbs_L15_unique, $verbs_L15_new_ones, $verbs_L15_so_far_undoub ], [ $verbs_L16_unique, $verbs_L16_new_ones, $verbs_L16_so_far_undoub ], [ $verbs_L17_unique, $verbs_L17_new_ones, $verbs_L17_so_far_undoub ], [ $verbs_L18_unique, $verbs_L18_new_ones, $verbs_L18_so_far_undoub ], [ $verbs_L19_unique, $verbs_L19_new_ones, $verbs_L19_so_far_undoub ], [ $verbs_L20_unique, $verbs_L20_new_ones, $verbs_L20_so_far_undoub ] ] ?> <table> <thead> <th>Lesson</th> #und hier auch, leicht modifiziert <th>All occurring verbs</th> <th>New ones only</th> <th>Piled up so far</th> </thead> <tbody> <?php $n =1 ?> <?php foreach($data as $lesson => $cols): ?> <tr> <td valign="top"><? echo "Lesson ".$n; $n++;?></td> <?php foreach($cols as $col => $verbs): ?> <td valign="top"> <?php foreach($verbs as $verb): ?> <div><?= $verb ?></div> <?php endforeach ?> </td> <?php endforeach ?> </tr> <?php endforeach ?> </tbody> </table> </body> </html>
....... $verbs_L3_unique = array_unique($verbs_L3_occurr); asort($verbs_L3_unique); $verbs_L4_unique = array_unique($verbs_L4_occurr); asort($verbs_L4_unique); $verbs_L5_unique = array_unique($verbs_L5_occurr); asort($verbs_L5_unique); ....... ....... $verbs_L(n)_unique = array_unique($verbs_L(n)5_occurr); asort($verbs_L(n)_unique);
....... $verbs_L10_so_far_unclean = array_merge($verbs_L10_unique, $verbs_L9_so_far_unclean); $verbs_L11_so_far_unclean = array_merge($verbs_L11_unique, $verbs_L10_so_far_unclean); $verbs_L12_so_far_unclean = array_merge($verbs_L12_unique, $verbs_L11_so_far_unclean); ...... ......
$verbs_L1 = ["machen", "erstellen", "generieren", "erzeugen", "machen", "erstellen"];
$verbs_L2 = ["verhauen", "verkloppen", "vertrimmen", "schlagen", "vertrimmen", "verhauen"];
$verbs = [];
$verbs["L1"] = ["machen", "erstellen", "generieren", "erzeugen", "machen", "erstellen"];
$verbs["L2"] = ["verhauen", "verkloppen", "vertrimmen", "schlagen", "vertrimmen", "verhauen"];
$verbs_L3_unique = array_unique($verbs_L3_occurr);
asort($verbs_L3_unique);
$verbs_L4_unique = array_unique($verbs_L4_occurr);
asort($verbs_L4_unique);
$verbs_L5_unique = array_unique($verbs_L5_occurr);
asort($verbs_L5_unique);
$verbsUnique = [];
foreach($verbs as $key => $verb) {
$verbsUnique[$key] = array_unique($verbs[$key]);
asort($verbsUnique[$key]);
}
Kommentar