Lets say an user submits some text that exceed the allowed number of characters. I don't want to deny the submission, rather I want it to only submit the first x amount of characters into the db. What's the function for that?
Simple... string=substr ( $string , 0 , length ) you could also shorten it to 3 less and add '...' on the end to show it had been shortened.