Steve84
Member
Posted 4 years ago #
Hi - I needed to connect to a WordPress database and pull information using my own PHP code. Mostly this works fine but I notice any quote marks are replaced by strange ? characters.
I am sure that this is someting to do with escaping, any suggestions?
Probably your own script/code is not working with the same encoding as WP. the default in WP is utf-8. Or, the page/site where you display anything pulled from the DB database is NOT utf-8 encoded.
Steve84
Member
Posted 4 years ago #
My page is a strict DOCTYPE using UTF-8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />.
I ran the data through this function $content = iconv("ISO-8859-1", "UTF-8", $content);
Now the quotes marks have disappeared completely - also the paragraph breaks have been removed - any ideas?
Steven