Guest daleosmond Posted June 17, 2006 Share Posted June 17, 2006 Hey,Does anyone know how i can only allow a string to be 20 char long at chop off the rest?thanka! Quote Link to comment https://forums.phpfreaks.com/topic/12242-string-lenth-please-help/ Share on other sites More sharing options...
AndyB Posted June 17, 2006 Share Posted June 17, 2006 [a href=\"http://ca.php.net/manual/en/function.substr.php\" target=\"_blank\"]substr() function[/a] Quote Link to comment https://forums.phpfreaks.com/topic/12242-string-lenth-please-help/#findComment-46668 Share on other sites More sharing options...
.josh Posted June 17, 2006 Share Posted June 17, 2006 are you talking about like, when the user enters in something in a form? if that's all you are trying to do, then simply adding a maxlength in your input tag will do the job:<input type = 'text' name = 'blah' maxlength = '20'> Quote Link to comment https://forums.phpfreaks.com/topic/12242-string-lenth-please-help/#findComment-46731 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.