weird charachters in PHP
<p>When reading text from word files, I get the following output. Some weird characters are printed out. Is there any way to remove them?</p>

<p><img src="http://i.stack.imgur.com/sYmYZ.png" alt="enter image description here"></p>

<pre><code>I use this function to read from docx files

function readDocx() {
    // Create new ZIP archive
    $zip = new ZipArchive;
    $dataFile = 'word/document.xml';
    // Open received archive file
    if (true === $zip-&gt;open($this-&gt;doc_path)) {
        // If done, search for the data file in the archive
        if (($index = $zip-&gt;locateName($dataFile)) !== false) {
            // If found, read it to the string
            $data = $zip-&gt;getFromIndex($index);
            // Close archive file
            $zip-&gt;close();
            // Load XML from a string
            // Skip errors and warnings
            $xml = DOMDocument::loadXML($data, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
            // Return data without XML formatting tags

            $contents = explode('\n',strip_tags($xml-&gt;saveXML()));
            $text = '';
            foreach($contents as $i=&gt;$content) {
                $text .= $contents[$i];
            }
            return $text;
        }
        $zip-&gt;close();
    }
    // In case of failure return empty string
    return "";
}
</code></pre>
