function views_json_strip_illegal_chars in Views Datasource 5
Strips illegal JSON characters in identifier string
Parameters
string $input:
Return value
string
2 calls to views_json_strip_illegal_chars()
File
- ./
views_json.module, line 245 - views_json.module - provides Views plugin for rendering node content as JSON.
Code
function views_json_strip_illegal_chars($input) {
$output = str_replace(array(
'{',
'}',
'[',
']',
':',
',',
'"',
"'",
chr(47),
chr(92),
), '', $input);
$output = preg_replace('/[\\x{80}-\\x{A0}' . '\\x{01}-\\x{1F}' . '\\x{0}]/u', '', $output);
return $output;
}