<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Read Word documents with PHP (up to Word 2003)	</title>
	<atom:link href="https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/feed/" rel="self" type="application/rss+xml" />
	<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/</link>
	<description>Coding is fun</description>
	<lastBuildDate>Sun, 27 Apr 2014 14:43:41 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.5</generator>
	<item>
		<title>
		By: can not open china doc		</title>
		<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-2717</link>

		<dc:creator><![CDATA[can not open china doc]]></dc:creator>
		<pubDate>Sat, 14 Jul 2012 09:12:57 +0000</pubDate>
		<guid isPermaLink="false">https://dannyherran.com/?p=157#comment-2717</guid>

					<description><![CDATA[不可以打开其他语言的文档，除了英文。
Can not open the documents of other languages​​, in addition to English.]]></description>
			<content:encoded><![CDATA[<p>不可以打开其他语言的文档，除了英文。<br />
Can not open the documents of other languages​​, in addition to English.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Vic		</title>
		<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-2657</link>

		<dc:creator><![CDATA[Vic]]></dc:creator>
		<pubDate>Tue, 26 Jun 2012 14:32:53 +0000</pubDate>
		<guid isPermaLink="false">https://dannyherran.com/?p=157#comment-2657</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-2656&quot;&gt;Vic&lt;/a&gt;.

its now showing my linebreak  &quot;&quot; on the line:
...
$outtext.=$newline.”&quot;;
...
It should go where the quotes are after =$newline.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-2656">Vic</a>.</p>
<p>its now showing my linebreak  &#8220;&#8221; on the line:<br />
&#8230;<br />
$outtext.=$newline.”&#8221;;<br />
&#8230;<br />
It should go where the quotes are after =$newline.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Vic		</title>
		<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-2656</link>

		<dc:creator><![CDATA[Vic]]></dc:creator>
		<pubDate>Tue, 26 Jun 2012 14:29:43 +0000</pubDate>
		<guid isPermaLink="false">https://dannyherran.com/?p=157#comment-2656</guid>

					<description><![CDATA[Hi, first I want to ty for the awesome solution, its helping me a lot but i have a comment and a question... 

Comment: to add a linebreak on each line I added a new variable on wich use reg_place() command and added that clean line to the var &quot;outtext&quot; something like this:

function parseWord($userDoc){
  $fileHandle = fopen($userDoc, &quot;r&quot;);
  $line = @fread($fileHandle,filesize($userDoc));
  $lines = explode(chr(0x0D),$line);
  $outtext = &quot;&quot;;
  $pos = strrpos($lines[1], chr(0x00));
  $outtext.=substr($lines[1],$pos).&quot;&quot;;
  foreach($lines as $thisline){
    $pos = strpos($thisline, chr(0x00)); 
    if(($pos !== FALSE) &#124;&#124; (strlen($thisline)==0)){
    } 
    else{
      $newline = $thisline;
      $newline = preg_replace(&quot;/^a-zA-Z0-9\s\,\.\-\n\r\t@\/\_\(\)/&quot;,&quot;&quot;,$newline);
      $outtext.=$newline.&quot;&quot;;
    }
  }
  return $outtext;
}

And now my question... 
I&#039;m gettin a lot of trash characters after the ok content of my doc, things like:&quot; !‰HÀüèæ’…?³KÍ3ÈIÚzó...  &quot; 
Am i doing something wrong? can anyone help me with this?]]></description>
			<content:encoded><![CDATA[<p>Hi, first I want to ty for the awesome solution, its helping me a lot but i have a comment and a question&#8230; </p>
<p>Comment: to add a linebreak on each line I added a new variable on wich use reg_place() command and added that clean line to the var &#8220;outtext&#8221; something like this:</p>
<p>function parseWord($userDoc){<br />
  $fileHandle = fopen($userDoc, &#8220;r&#8221;);<br />
  $line = @fread($fileHandle,filesize($userDoc));<br />
  $lines = explode(chr(0x0D),$line);<br />
  $outtext = &#8220;&#8221;;<br />
  $pos = strrpos($lines[1], chr(0x00));<br />
  $outtext.=substr($lines[1],$pos).&#8221;&#8221;;<br />
  foreach($lines as $thisline){<br />
    $pos = strpos($thisline, chr(0x00));<br />
    if(($pos !== FALSE) || (strlen($thisline)==0)){<br />
    }<br />
    else{<br />
      $newline = $thisline;<br />
      $newline = preg_replace(&#8220;/^a-zA-Z0-9\s\,\.\-\n\r\t@\/\_\(\)/&#8221;,&#8221;&#8221;,$newline);<br />
      $outtext.=$newline.&#8221;&#8221;;<br />
    }<br />
  }<br />
  return $outtext;<br />
}</p>
<p>And now my question&#8230;<br />
I&#8217;m gettin a lot of trash characters after the ok content of my doc, things like:&#8221; !‰HÀüèæ’…?³KÍ3ÈIÚzó&#8230;  &#8221;<br />
Am i doing something wrong? can anyone help me with this?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ash		</title>
		<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-2330</link>

		<dc:creator><![CDATA[Ash]]></dc:creator>
		<pubDate>Mon, 19 Mar 2012 08:19:24 +0000</pubDate>
		<guid isPermaLink="false">https://dannyherran.com/?p=157#comment-2330</guid>

					<description><![CDATA[does anyone has the version to read documents from word 2007 yet?? badly need this]]></description>
			<content:encoded><![CDATA[<p>does anyone has the version to read documents from word 2007 yet?? badly need this</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: bapu		</title>
		<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-2046</link>

		<dc:creator><![CDATA[bapu]]></dc:creator>
		<pubDate>Sun, 05 Feb 2012 03:49:00 +0000</pubDate>
		<guid isPermaLink="false">https://dannyherran.com/?p=157#comment-2046</guid>

					<description><![CDATA[it simply good code but iam seeing the doucument without break. please help me]]></description>
			<content:encoded><![CDATA[<p>it simply good code but iam seeing the doucument without break. please help me</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: felix		</title>
		<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-1931</link>

		<dc:creator><![CDATA[felix]]></dc:creator>
		<pubDate>Thu, 17 Nov 2011 22:34:19 +0000</pubDate>
		<guid isPermaLink="false">https://dannyherran.com/?p=157#comment-1931</guid>

					<description><![CDATA[how would I use the above code with antiword or abiword?  Any example code?]]></description>
			<content:encoded><![CDATA[<p>how would I use the above code with antiword or abiword?  Any example code?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Missing Top Line		</title>
		<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-1730</link>

		<dc:creator><![CDATA[Missing Top Line]]></dc:creator>
		<pubDate>Wed, 13 Jul 2011 00:40:37 +0000</pubDate>
		<guid isPermaLink="false">https://dannyherran.com/?p=157#comment-1730</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-1729&quot;&gt;Missing Top LIne&lt;/a&gt;.

Hi, 

I fixed it with this: 
[code]
function parseWord($userDoc)
	{
		$fileHandle = fopen($userDoc, &#034;r&#034;);
		$line = @fread($fileHandle,filesize($userDoc));
		$lines = explode(chr(0x0D),$line);
		$outtext = &#034;&#034;; 
		$pos = strrpos($lines[1], chr(0x00));
		$outtext.=substr($lines[1],$pos).&#034;&#034;;
		foreach($lines as $thisline)
		{
			$pos = strpos($thisline, chr(0x00)); 
	
			if(($pos !== FALSE) &#124;&#124; (strlen($thisline)==0))
			{
				
			} else {
				$outtext.=$thisline.&#034;&#034;;
			}
		}
		
		
		return $outtext;
	}
[/code]]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-1729">Missing Top LIne</a>.</p>
<p>Hi, </p>
<p>I fixed it with this: </p>
<pre class="brush: plain; title: ; notranslate">
function parseWord($userDoc)
	{
		$fileHandle = fopen($userDoc, &quot;r&quot;);
		$line = @fread($fileHandle,filesize($userDoc));
		$lines = explode(chr(0x0D),$line);
		$outtext = &quot;&quot;; 
		$pos = strrpos($lines&#x5B;1], chr(0x00));
		$outtext.=substr($lines&#x5B;1],$pos).&quot;&quot;;
		foreach($lines as $thisline)
		{
			$pos = strpos($thisline, chr(0x00)); 
	
			if(($pos !== FALSE) || (strlen($thisline)==0))
			{
				
			} else {
				$outtext.=$thisline.&quot;&quot;;
			}
		}
		
		
		return $outtext;
	}
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Missing Top LIne		</title>
		<link>https://dannyherran.com/2011/02/read-word-documents-with-php-up-to-word-2003/#comment-1729</link>

		<dc:creator><![CDATA[Missing Top LIne]]></dc:creator>
		<pubDate>Tue, 12 Jul 2011 20:03:11 +0000</pubDate>
		<guid isPermaLink="false">https://dannyherran.com/?p=157#comment-1729</guid>

					<description><![CDATA[Hi, 

I found that this skips the first line of the document.  Any idea on how to prevent that?  

Otherwise works perfectly!  

- Missing Top Line.]]></description>
			<content:encoded><![CDATA[<p>Hi, </p>
<p>I found that this skips the first line of the document.  Any idea on how to prevent that?  </p>
<p>Otherwise works perfectly!  </p>
<p>&#8211; Missing Top Line.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Database Caching using Disk

Served from: dannyherran.com @ 2026-07-24 00:46:45 by W3 Total Cache
-->