Checking how many letters are in a string.
| From: | Dotan Cohen | Date: | Wed, 19 Mar 2008 16:39:19 +0000 |
| Subject: | Checking how many letters are in a string. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-271822@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?
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?