Convert special characters like ' \t ' to " \t " (a real tab)
You should probably decide what special chars will you allow and create a function like this one:
function translate_quoted($string) {
$search = array("\\t", "\\n", "\\r");
$replace = array( "\t", "\n", "\r");
return str_replace($search, $replace, $string);
}
echo str_replace("\\t", "\t", $string);
View an example here: http://ideone.com/IVFZk