Auth_Yadis_ParseHTML::removeQuotes PHP Метод

removeQuotes() публичный Метод

Strip single and double quotes off of a string, if they are present.
public removeQuotes ( string $str ) : string
$str string The original string
Результат string $new_str The new string with leading and trailing quotes removed
    function removeQuotes($str)
    {
        $matches = array();
        $double = '/^"(.*)"$/';
        $single = "/^\\'(.*)\\'\$/";
        if (preg_match($double, $str, $matches)) {
            return $matches[1];
        } else {
            if (preg_match($single, $str, $matches)) {
                return $matches[1];
            } else {
                return $str;
            }
        }
    }