mysql - PHP remove single-quote in (utf-8?) string
Get the solution ↓↓↓I want to load strings from a utf-8 mysql tables and compare them to strings which I load from a .csv file in PHP. I have (I assume) an encoding problem and struggle to compare identical strings with a single quote in them. The single quote seems to be different between the strings I loaded from the DB and the one from the .csv file.
for instance:Hello'World
has followingbin2hex
dump between .csv and the string loaded from a mysql-table
mysql:68656c6c6f[26233033393b]776f726c64
csv: 68656c6c6f776f726c64
It would be fine to just remove the single quote from the mysql string but all attempts toregex
it away or dostr_replace
failed. Also running explicitutf8_encode/utf8_decode
didn't help to get a string that evaluates positive for an equality check but I don't get this string cleaned.
does someone has an idea how to handle the single quote? It would be possible to rebuild the database table in a different encoding (currently its UTF-8) if this would be easier?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: object of class stdclass could not be converted to string
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.