For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > April 2004 > string length









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author string length
Jeremy Watts

2004-04-21, 6:34 pm

how do you find the length of a string in php?? there seems to be every
command under the sun in the manual to operate on strings but not one for
finding a strings length...


Michael Vilain

2004-04-21, 8:35 pm

In article <aQBhc.70$Rc2.49@newsfe1-win>,
"Jeremy Watts" <jeremy.watts70@ntlworld.com> wrote:

> how do you find the length of a string in php?? there seems to be every
> command under the sun in the manual to operate on strings but not one for
> finding a strings length...


http://www.php.net/strlen

--
DeeDee, don't press that button! DeeDee! NO! Dee...



Steffan S. Fallesen

2004-04-22, 4:30 am

Jeremy Watts wrote:
> how do you find the length of a string in php?? there seems to be every
> command under the sun in the manual to operate on strings but not one for
> finding a strings length...


$s = "Charles went to school";
$r = strlen ($s);
echo "String is " . $r . " char";

# String is 22 char

--
Steffan
Don’t miss out! Use this coupon code ‘USEN’ and save 40%
on our webhosting package – http://www.servage.net

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com