Hi Thomas,

> public function getAlpha($name, $locale = false) {
>    $characters = 'a-z';
>    if ($locale ! = = false) {
>        $characters = Zend_Locale_Data::getContent($locale, 'characters');
>    }
>    preg_match($characters, '/[' . $characters . ']/', $result);
>    return $result;
> }

I like your idea, especially leaving locale-dependent details to
Zend_Locale. I have a couple of questions related to this:

1. What are your thoughts about passing $locale to the constructor
instead of each individual method?

2. Is there a clever solution that would let people allow multiple
locales? For example, even if I don't need to allow all possible
alphabetic characters, I might want to all possible English, French,
Spanish, and German alphabetic characters. I haven't looked at
Zend_Locale, so my apologies if this is a redundant question.

Thanks for your time.

Chris

Reply via email to