I need a PHP code to count Chinese and English words in a string. This string is actually a mix of Chinese and English words, and some other characters. This is the behavior that I want:
1. Count each Chinese character as a "word" (yes, I understand that this is not always the case, but I can allow to simplify it like this).
2. Count each English word as one word (i.e. don't count them as characters).
3. Count each number as one word (i.e. "1 2 3 456" is 4 words).
4. Ignore everything else (i.e. commas, dots, hyphens, spaces, tabs, enters, etc etc)
Below is an example string and expected result (please note I use "X" to substitute Chinese characters, since Freelancer seems to have a problem handling Chinese characters):
$string = "dog cat XXXXX 4 5 100 a b c cat, dog, home. XXXXX. XXX,dogXXXX. 67XX45XXXX23XXdfagXXX67!!!! All! ME? #%@^@%#&*())@(*;'<>/\";
international_word_count($string); should return 47.
This project is based on hourly budget. Please specify how much time this is going to take you and what's your hourly rate.