Technique for extracting text from msword files into php var

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dickey
Forum Commoner
Posts: 50
Joined: Thu May 16, 2002 8:04 pm
Location: Sydney, Australia

Technique for extracting text from msword files into php var

Post by dickey »

I am attempting to preview centrally stored ms word files.

I would like to read a ms word file and store text only (ex meta data and formatting codes) into a var, and then display some or all of the text.

I am familar with doing this for text files eg.

Code: Select all

$myfile = "C:\\mydocument.txt";
$myopenfile = fopen($myfile, "rb");
$contents = fread($myopenfile, filesize($myfile));
fclose ($myopenfile);
echo $contents;
The question arises is their a technique that maybe used with msword or other rich text files that loses the meta data and formatting tags, leaving the documents text only.

Any help greatly appreciated, Thank you.

- Andrew
DeGauss
Forum Contributor
Posts: 105
Joined: Tue Oct 22, 2002 9:44 am
Location: Gainesville, FL

Post by DeGauss »

Good luck buddy.

Seriously.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

I think there was a script that process the MS word document. Try searching this forum...
Post Reply