Suppose there is some kind of web service. He should get some string from the client. It is not special in terms of format, no regular expressions are needed. Generally speaking, it’s not so important whether there are 10 characters or 10 thousand characters.
However, the memory is in any case limited. Accordingly, if you can send a string of unlimited length, in theory it can happen that there is not enough storage space.
I found that you can set a limit in php.ini for a POST request. Then maybe you should not worry about the entered data? If anything, there will be an error.
So how should you do the right thing? Do I need to check for the length of any data obtained before recording?