PHP Learn How To Count Characters Letters Are In A String Script Function

RegisterLogin
PHP Learn How To Count Characters Letters Are In A String Script Function
Post Description: PHP Learn How To Count Characters Letters Are In A String Script Function
Tags: PHP, Learn, How, To, Count, Characters, Letters, Are, In, A, String, Script, Function
This Post Was Posted On Feb 29, 2008 By web hosting #1217
the other day i wanted to limit the amount of characters in a form, instead of relying on the user, i found out how to do this with php. php has a fucntion called strlen($string) that gives you the amount of characters in a string, the string can be letter or numbers in a sentence or paragraph.

so if you want to write a script to check the number of characters a user to your web site has submitted, you can do this with php with the strlen($string); function. with this function you can tell how many characters you have in a string.

the following code will output 12


     Code:
$string="wallpaperama";

$num_char=strlen($string);

echo $num_char;


hope this helps, if you have any other tips, let me know write you comments or reply to this post. thanks.
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
Fabulous !
#1655 1
php is soooo powerful ! i'm definitely glad to have switched to this language.

truly impressive
Feb 14, 2008 Reply Report abuse
©2011 Webune Forums - Tue Dec 20, 2011 5:02 pm
Powered by: Webune Forums V3