protected function clean($x)
{
if (is_array($x)) {
foreach ($x as $k => $v) {
$x[$k] = $this->clean($v);
}
} else {
// Remove double quotes from start and end of string
if ($x == '') {
return '';
}
if ($x[0] == '"') {
$x = substr($x, 1, -1);
}
// Escapes C-style escape sequences (\a,\b,\f,\n,\r,\t,\v) and converts them to their actual meaning
$x = stripcslashes($x);
}
return $x;
}