Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest daleosmond

String Lenth please help!

Recommended Posts

Guest daleosmond
Hey,
Does anyone know how i can only allow a string to be 20 char long at chop off the rest?
thanka!

Share this post


Link to post
Share on other sites
[a href=\"http://ca.php.net/manual/en/function.substr.php\" target=\"_blank\"]substr() function[/a]

Share this post


Link to post
Share on other sites
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'>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.