Return to Snippet

Revision: 17392
at September 2, 2009 20:09 by scopefragger

Initial Code
$varable = 'thisisatest';
echo strlen($varable); // 11

$varable = '1234567';
echo strlen($varable); // 7

//Nof for an 'if' example

Initial URL

Initial Description
Sometimes counting the length of a variable is a necessity, such as when a new user registers. You may restrict a limit of 10 characters as a username or password, Using the following php function you can count the length of a variable.

In additionally I have provided an example ‘If’ statement that could be used in a username length validation.

Initial Title
Count Varable character lengh

Initial Tags

Initial Language