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! 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] 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'> Link to comment https://forums.phpfreaks.com/topic/12242-string-lenth-please-help/#findComment-46731 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.