If you want to know the length of a string in PHP you would normally turn to the strlen() function which simply tells you the length of the string.
$string = 'this is a string';
To use this to check the length of the string use the following example.
$string = 'this is a string'; <p>A quicker way of looking at the length of a string would be to use the isset() function in conjunction with the curly braces {} used for locating character from a string.</p> <code class="php">$string = 'this is a string'; // stringtoo short }</code>
0 comments:
Post a Comment