Re: string size in bytes

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

 



On Sun, Feb 12, 2006 at 08:13:42PM -0600, Philip Hallstrom wrote:
> >i need to know how many bytes are in a string
> >
> >example:
> >
> >$string = "blah";
> >
> >string == how many bytes
> 
> Well, if you're willing to ignore all the unicode stuff, you can use 
> strlen() since 1 byte = 1 character.  Check that manpage to see if there's 
> a unicode safe version.

strlen will count bytes but not necessarily characters (if unicode
is used)

Curt.
-- 
cat .signature: No such file or directory

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


[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