function socialcalc_parse_values in Sheetnode 5
Same name and namespace in other branches
- 6 socialcalc.inc \socialcalc_parse_values()
- 7.2 socialcalc.inc \socialcalc_parse_values()
- 7 socialcalc.inc \socialcalc_parse_values()
File
- ./
socialcalc.inc, line 390 - SocialCalc manipulation functions Translated from socialcalc-3.js and companion files
Code
function socialcalc_parse_values($data) {
$line = strtok($data, "\n");
$sheet = array();
while ($line !== FALSE) {
$line = rtrim($line);
$parts = explode(':', $line);
if ($parts[0] == 'cell') {
$coord = $parts[1];
$cell = isset($sheet['cells'][$coord]) ? $sheet['cells'][$coord] : array();
$cell += socialcalc_parse_cell_value($parts, 2);
$sheet['cells'][$coord] = $cell;
}
$line = strtok("\n");
}
return $sheet;
}