Saturday 8 December 2018

php - Whitespace in a database field is not removed by trim()

I have some whitespace at the begining of a paragraph in a text field in MySQL.



Using trim($var_text_field) in PHP or TRIM(text_field) in MySQL statements does absolutely nothing. What could this whitespace be and how do I remove it by code?



If I go into the database and backspace it out, it saves properly. It's just not being removed via the trim() functions.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...