Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This had happend to me too. Couple of things:</p> <ul> <li><p>Use <code>htmlentities</code> function for your text</p> <p><code>$my_text = htmlentities($string, ENT_QUOTES, 'UTF-8');</code></p></li> </ul> <p><strong><a href="http://de.php.net/htmlentities" rel="noreferrer">More info about the htmlentities function.</a></strong></p> <ul> <li><p>Use proper document type, this did the trick for me.</p> <p><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</code></p></li> <li><p>Use <strong>utf-8</strong> encoding type in your page:</p> <p><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;</code></p></li> </ul> <p>Here is the final prototype for your page:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php // your code related to database $my_text = htmlentities($string, ENT_QUOTES, 'UTF-8'); ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>.</p> <p>If you want to <strong>replace</strong> it however, try the <a href="http://www.php.net/manual/en/function.mb-ereg-replace.php" rel="noreferrer"><strong><code>mb_ereg_replace</code></strong></a> function.</p> <p><strong>Example:</strong></p> <pre><code>mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); $my_text = mb_ereg_replace("’","'", $string); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload