substr problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tuananh87vn
    New Member
    • Sep 2007
    • 63

    substr problem

    hi,
    i'm dealing with kind of getting a desired number of letters from a text to be printed out and i'm using php's substr to cut them out. if the text in in form of normal character, it's ok, however, as there are special characters (anyone knows about Vietnamese) which cannot, uh, normally be 'substring-ed'

    some special chars like â, ®, ©... require more than 1 bytes.. anybody knows how to handle them?

    thx alot :D
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, tuananh87vn.

    Check out mb_substr() (PHP: mb_substr - Manual).

    Comment

    Working...