I have an entity with a textfield created using the core Fields feature that looks like this when I inspect the type of the field table in the database
I want to be able to determine max size of the string that can go into this field programmatically. I.e. I want do know if there is a function I can call with suitable parameters, and it would return 40.
A Drupal API function would be the preferred answer, but a could live with a PHP function if this is not available in the Drupal API.
I was reminded in a comment (now deleted) that I previously had answered a very similar question.
However, that answer relies on the field in question being part of a schema.
This new question is about fields that has been created using the core Fields feature. (I.e. using
drupal_get_schema() will not fly.