Changeset 174
- Timestamp:
- 12/02/11 16:19:33 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/Session.php
r173 r174 68 68 return; 69 69 70 //Get the answers for all respondents 70 71 $answers = $this->getAnswers($headers); 71 72 … … 82 83 $entryString = ""; 83 84 //PHP doesn't automatically sort the indices so I have to do it myself 84 $keys = array_keys($entry);85 asort($keys);86 85 //Entry elements can now be printed in order to match the headers 87 for each($keys as $i)86 for ($i = 0; $i < count($headers); $i++) 88 87 { 89 $entryString = $entryString . $entry[$i] . "\t"; 88 if(in_array($i, array_keys($entry))) 89 $entryString = $entryString . $entry[$i] . "\t"; 90 else 91 $entryString = $entryString . "\t"; 90 92 } 91 93 fwrite($fileHandler, $entryString . "\n"); … … 134 136 $value = $value . $val . ","; 135 137 } 138 //We all hate trailing commas 136 139 if (strlen($value) > 0) { $value = substr($value, 0, strlen($value)-1); } 137 140 $entry[$index] = $value;
Note: See TracChangeset
for help on using the changeset viewer.