Jump to content


Photo

Length of a Word


  • Please log in to reply
2 replies to this topic

#1 JackJack

JackJack
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 15 May 2006 - 12:04 PM

How can i check how long a word is???

My code is

}elseif(empty($_POST['username']) <= 3)
{
  echo '
    <font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
         • Invalid username: must be between 3 - 15 characters
    </font>';
  $show_form = 1;
}

But its defently wrong [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]

Ty

#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 15 May 2006 - 01:30 PM

[a href=\"http://no.php.net/manual/en/function.strlen.php\" target=\"_blank\"]http://no.php.net/manual/en/function.strlen.php[/a]
$str = 'abcdef';
echo strlen($str); // 6


#3 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 15 May 2006 - 02:35 PM

[a href=\"http://php.net/strlen\" target=\"_blank\"]rtfm[/a].




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users