In the "entries.txt" file from which entries are added from a form. Each new entry appears on a separate line in the following format:
date|host|name|email|state|answer1|answer2|answer3|textanswer1|answer4|text answer2
date|host|name|email|state|answer1|answer2|answer3|textanswer1|answer4|text answer2
Each "answerX" is multi-choice.
Answer1 = for or against
Answer2 = yes or no
Answer3 = yes or no
Answer4 = yes or no
I want a script to be able to count how many
e.g. fors and againsts appear in the answer1 area, and so on for each "answerX" field" (dont worry about the textanswerX's, they're not part of the graphical stats) Then once it's counted the number of answers for each option. I want it to write to a plain text file each one in the form of
$for = "X";
$ag = "X";
$yes1 = "X";
$no1 = "X";
and so on.
I want percentages as well, but once each figure it's added up I can make it do the percentages easily. and create the stats file from the results written to the results.txt file from this process.
Im working with explode() which works well. It's just exploding each line and calculating the number of answers that I'm stuck with.
Thanks in advance. If you can help, or need more info, please ask.