Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

number of characters
Hello,

How do I count the numbers of charaters in a string/variabele?

thnx,

InSeCo




Report this thread to moderator Post Follow-up to this message
Old Post
InSeCo
04-16-05 08:56 PM


Re: number of characters
InSeCo wrote:
> Hello,
>
> How do I count the numbers of charaters in a string/variabele?
>
> thnx,
>
> InSeCo

Including spaces and other non-printable characters?

$num = strlen($mystring);

Might wanna trim of extra spaces at the end first.

$num = strlen(trim($mystring));

--
___|   ___|  _ \ _ _|  _ \__ __| __ \  |   | __ \  ____|
\___ \  |     |   |  |  |   |  |   |   | |   | |   | __|
| |     __ <   |  ___/   |   |   | |   | |   | |
_____/ \____|_| \_\___|_|     _|  ____/ \___/ ____/ _____|
Computers will never take the place of books. You can't stand on a
floppy disk to reach a high shelf.
I thought 'Deep Throat' was a movie about a giraffe :/



Report this thread to moderator Post Follow-up to this message
Old Post
Scriptdude
04-16-05 08:56 PM


Re: number of characters
"InSeCo" <luyendyk@yahoo.com.news> kirjoitti
viestissä:d3qv55$q7p$1@reader10.wxs.nl...
> Hello,
>
> How do I count the numbers of charaters in a string/variabele?
>

Since the concept of function reference is totally unknown to you, let me
tell you about it. There's this website php.net where there is documented a
great big collection of php functions. They are categorized for easy access.
There, from the string functions, you would've found precisely what you were
looking for: a function called strlen();

See http://www.php.net/manual/en/function.strlen.php for details.

In the future: please check the documentation before asking this simple
questions that really aren't worth answering. It's there, online. All the
time. You can download it in various formats...



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-16-05 08:56 PM


Re: number of characters
InSeCo wrote:
> Hello,
>
> How do I count the numbers of charaters in a string/variabele?
>
> thnx,
>
> InSeCo

Including spaces and other non-printable characters?

$num = strlen($mystring);

Might wanna trim of extra spaces at the end first.

$num = strlen(trim($mystring));

--
___|   ___|  _ \ _ _|  _ \__ __| __ \  |   | __ \  ____|
\___ \  |     |   |  |  |   |  |   |   | |   | |   | __|
| |     __ <   |  ___/   |   |   | |   | |   | |
_____/ \____|_| \_\___|_|     _|  ____/ \___/ ____/ _____|
Computers will never take the place of books. You can't stand on a
floppy disk to reach a high shelf.
I thought 'Deep Throat' was a movie about a giraffe :/



Report this thread to moderator Post Follow-up to this message
Old Post
Scriptdude
04-19-05 08:57 AM


Re: number of characters
"InSeCo" <luyendyk@yahoo.com.news> kirjoitti
viestissä:d3qv55$q7p$1@reader10.wxs.nl...
> Hello,
>
> How do I count the numbers of charaters in a string/variabele?
>

Since the concept of function reference is totally unknown to you, let me
tell you about it. There's this website php.net where there is documented a
great big collection of php functions. They are categorized for easy access.
There, from the string functions, you would've found precisely what you were
looking for: a function called strlen();

See http://www.php.net/manual/en/function.strlen.php for details.

In the future: please check the documentation before asking this simple
questions that really aren't worth answering. It's there, online. All the
time. You can download it in various formats...



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-19-05 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:18 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.