_locale_import_parse_quoted
includes/locale.inc, строка 1092
- Версии
- 5 – 6
_locale_import_parse_quoted($string)
Parses a string in quotes
Параметры
$string
A string specified with enclosing quotes
Возвращаемое значение
The string parsed from inside the quotes
Код
<?php
function _locale_import_parse_quoted($string) {
if (substr($string, 0, 1) != substr($string, -1, 1)) {
return FALSE; // Start and end quotes must be the same
}
$quote = substr($string, 0, 1);
$string = substr($string, 1, -1);
if ($quote == '"') { // Double quotes: strip slashes
return stripcslashes($string);
}
elseif ($quote == "'") { // Simple quote: return as-is
return $string;
}
else {
return FALSE; // Unrecognized quote
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии