Reputation: 2477
When I get some data from my database and output it to my html table, I get some "?" at the end of the data.
Example
echo "<td>" . $row['data'] . "</td>";
gives
John Data��
So, how to remove the funny "��"?
Upvotes: 2
Views: 2008
Reputation: 3833
trim() is for whitespace. The funny"��" is an encoding-problem. Try utf8_decode or utf8_encode function on $row['data'].
Upvotes: 3
Reputation: 9671
You can trim white spaces in PHP:
echo "<td>" . trim($row['data']) . "</td>";
But I think it's more of an encoding problem.
Upvotes: 2