Re: Size of a string

From: Date: Wed, 05 Jul 2000 13:35:41 +0000
Subject: Re: Size of a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4931@lists.php.net to get a copy of this message
I've looked in all our documentation and there is a function called sizeof() but this is for counting the number of FILLED elements in an array. Apart from that, all I can say is use strlen() if you can trust it to give you the required figure you are looking for. I can't think why checking for the length of string wouldn't return the same value as checking it's size but I'm not a guru on this issue. Andy. ----- Original Message ----- From: "Corey Mosher" <corey@hub.org> To: <php-general@lists.php.net> Sent: Wednesday, July 05, 2000 2:06 PM Subject: Re: [PHP] Size of a string > In this case it is since 1 char = 1 byte, I was just looking > for something designed exactly to figure out how many bytes > the string is using. Strlen will work though. > > Corey > > On Wed, 5 Jul 2000, Andy Woolley wrote: > > > Is that not the same thing? > > > > Andy > > > > ----- Original Message ----- > > From: "Corey Mosher" <corey@hub.org> > > To: <php-general@lists.php.net> > > Sent: Wednesday, July 05, 2000 1:53 PM > > Subject: Re: [PHP] Size of a string > > > > > > > No, I mean the size in bytes, not the length. Sizeof in c determines > > > the size in bytes, strlen determines the length. > > > > > > Corey > > > > > > On Wed, 5 Jul 2000, Daniel Gustafsson wrote: > > > > > > > At 08:33 AM 7/5/00 -0400, you wrote: > > > > >Hello, > > > > > Does anyone know how to get the size in bytes of a string? > > > > >Is there a function similar to the c function sizeof? > > > > > > > > You mean the length of the string?.. strlen(), that's what you use in C > > too =) > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > > > For additional commands, e-mail: php-general-help@lists.php.net > > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > > Corey Mosher > > > Hub.Org Networking Services > > > Wolfville, NS > > > Canada > > > corey@hub.org > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-general-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > > Corey Mosher > Hub.Org Networking Services > Wolfville, NS > Canada > corey@hub.org > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#4931) next »