Re: Checking how many letters are in a string.

From: Date: Wed, 19 Mar 2008 16:44:00 +0000
Subject: Re: Checking how many letters are in a string.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-271825@lists.php.net to get a copy of this message
I need to count how many Hebrew characters a given string has. I have been checking, character by character, if the given character is a [א-ת] and if so I simply ++ the counting variable. It turns out that this is rather resouce intensive, and I may need a better way of doing this. I have looked at count_chars and considered writing a wrapper function for each of the 27 letters of the Hebrew alphabet, but I am quite sure that there is a cleverer method. Any ideas?
You may want to investigate mb_strlen(): http://uk.php.net/mb_strlen -- Richard Heyes Employ me: http://www.phpguru.org/cv

« previous php.general (#271825) next »