Re: Checking how many letters are in a string.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/03/2008, TG <tg-php@xxxxxxxxxxxxxxxxxxxxxx> wrote:>>  Is the question:>>  "How do I tell how many characters are in a string that may contain Hebrew characters?">>  or is the question...>>  "How do I tell how many Hebrew characters are in a string that may contain Hebrew and non-Hebrew characters.. but I only want a count of the Hebrew characters?">>  or maybe even...>>  "How do I tell if there are Hebrew characters in a string?   Regardless of actual count?">>>  The mb_strlen() sounds like it would work for the first question, but that's not exactly what you asked.  What you asked was closer to the second question, which wouldn't be solved by using mb_strlen() I believe.   In the second two cases, you might be able to use a preg_match type search.>>  If no other functions work, you could parse the string into an array and compare against an array containing hebrew characters.>>>  -TG
I am asking the second question: how many Hebrew characters in astring that _very_likely_ contains other characters as well. The arraysuggestion sounds about what I am doing: checking if each letter is aHebrew character.
I will also look into the mb_ functions. I did not know about thembefore. Thanks.
Dotan Cohen
http://what-is-what.comhttp://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?

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux