Code Comments
Programming Forum and web based access to our favorite programming groups.Hello, How do I count the numbers of charaters in a string/variabele? thnx, InSeCo
Post Follow-up to this messageInSeCo 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 :/
Post Follow-up to this message"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...
Post Follow-up to this messageInSeCo 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 :/
Post Follow-up to this message"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...
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.