#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    7
    Rep Power
    0

    How to get characters of a unicode string in PHP?


    Hi

    I have a Unicode string and I want to access the individual characters in that string.
    the code I write is:

    Code:
    $unicode_string{10};
    but this doesn't work. how can I do this? Is there a special function for Unicode strings?
  2. #2
  3. Jealous Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,302
    Rep Power
    9400
    Unicode is just as much a character encoding as the English alphabet is. What is to say it's not.

    You can't use array syntax but you can use mb_substr.

IMN logo majestic logo threadwatch logo seochat tools logo