View Full Version : changing word file
03-14-2007, 06:07 PM
I am trying this code to edit word file, it works fine if the both strings are same lenght but not if both are of different length.
$tmp = str_replace ("sys" , "asd",$tmp);
$tmp= file_put_contents("work2.doc" , $tmp);
03-14-2007, 06:35 PM
Yeah good luck with that... a Word file is a far cry from a plain text file and you can't expect to be able to treat it like a plain text file.
03-14-2007, 08:02 PM
Yeah, word documents are filled with extra formatting information along with the text. You might have better luck trying to find a class (http://www.phpclasses.org/browse/package/3553.html) to help you modify the file.
03-15-2007, 09:01 AM
i think supports OLE Container format (that of doc files) can do something
but not sure of it.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.