[PHP] How can a UTF-8 string can be converted to an array of Bytes?

2011-05-25 Thread Eli Orr (Office)

Hi,

Since a UTF-8 is a multi-bytes mechanism I get for 2 or 3 bytes  UTF-8 
encoded character a single character


How can it be break into the REAL bytes array that represent the UTF-8 
string

 and how  can we reassembled the bytes array  back to UTF-8?

--
Best Regards,

*Eli Orr*
CTO  Founder
*LogoDial Ltd.*

__


Re: [PHP] How can a UTF-8 string can be converted to an array of Bytes?

2011-05-25 Thread Eric Butera
On Wed, May 25, 2011 at 8:15 AM, Eli Orr (Office) eli@logodial.com wrote:
 Hi,

 Since a UTF-8 is a multi-bytes mechanism I get for 2 or 3 bytes  UTF-8
 encoded character a single character

 How can it be break into the REAL bytes array that represent the UTF-8
 string
  and how  can we reassembled the bytes array  back to UTF-8?

 --
 Best Regards,

 *Eli Orr*
 CTO  Founder
 *LogoDial Ltd.*

 __


You can use mb_substr [1] with a UTF-8 encoding to get the single characters.

http://us.php.net/mb_substr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php