You are here

function JSON::toString in Drupal Most Popular 7

Convert String variables

Parameters

string $e Variable with an string value: @access private @return string Serialized variable

1 call to JSON::toString()
JSON::_serialize in modules/mostpopular_disqus/disqusapi/json.php
Internal Serializer

File

modules/mostpopular_disqus/disqusapi/json.php, line 371

Class

JSON
JSON

Code

function toString($e) {
  $rep = array(
    "\\",
    "\r",
    "\n",
    "\t",
    "'",
    '"',
  );
  $val = array(
    "\\\\",
    '\\r',
    '\\n',
    '\\t',
    '\'',
    '\\"',
  );
  $e = str_replace($rep, $val, $e);
  return $e;
}