You are here

function socialcalc_encode_value in Sheetnode 7.2

Same name and namespace in other branches
  1. 5 socialcalc.inc \socialcalc_encode_value()
  2. 6 socialcalc.inc \socialcalc_encode_value()
  3. 7 socialcalc.inc \socialcalc_encode_value()
2 calls to socialcalc_encode_value()
socialcalc_save_cell in ./socialcalc.inc
socialcalc_save_sheet in ./socialcalc.inc

File

./socialcalc.inc, line 855
SocialCalc manipulation functions.

Code

function socialcalc_encode_value($s) {
  if (!is_string($s)) {
    return $s;
  }
  return str_replace(array(
    '\\',
    ':',
    "\r\n",
    "\n",
  ), array(
    '\\b',
    '\\c',
    '\\n',
    '\\n',
  ), $s);
}