Trim not working

I have a mysql database which has a lot of keywords.

Such as ‘Apple’ however it’s been stored by a previous user as ’ Apple’ with an empty space or spacebar entry before it.

I want to loop through the results and trim the text and update it however it’s not trimming this space

I’m doing this to text it

$Word = trim($row[‘Word’]);
echo ‘>>’ . $row[‘Word’] . ‘<<’;

I already answered you on the other forum.

Why wouldn’t you keep this in the database? You can do an update across the table.

Which was my answer in the other forum along with the SQL to do it.

1 Like

Adding on… I will guess that first character is NOT a space, but, a non-displayable character.
You should print the hexadecimal value of it and see what it really is!

His problem was it was &nbsp;

Hate those ! ! ! LOL

Sponsor our Newsletter | Privacy Policy | Terms of Service