web2000 Posted April 23, 2007 Share Posted April 23, 2007 Hi, I have got the following code to create a new word document and change the characters “” with “” but if the lengths are the same for instance “sam” and “dav” or “rag” and “dfj” it works but if the values are different lengths for eg “sam” “samasma” it doesn’t work Any help? Thanks $filename = "C:/Webspace/nich/tempdocs/agreement.doc"; $f="C:/Webspace/nich/realdocs/test1.doc"; $fp = fopen($f, 'wb'); $fp_temp = fopen($filename, 'rb'); global $T_Tenancy; $rentagreed = $T_Tenancy->rentagreed->GetValue(); $old_contents = fread ( $fp_temp, filesize ($filename)); fclose ( $fp_temp); $constants=str_replace("rent754",$rentagreed,$old_contents); fwrite($fp, $constants); fclose($fp); Link to comment https://forums.phpfreaks.com/topic/48344-str-replace-problems/ Share on other sites More sharing options...
web2000 Posted April 23, 2007 Author Share Posted April 23, 2007 Can anyone help? Link to comment https://forums.phpfreaks.com/topic/48344-str-replace-problems/#findComment-236431 Share on other sites More sharing options...
MadTechie Posted April 23, 2007 Share Posted April 23, 2007 some sample data always helps Link to comment https://forums.phpfreaks.com/topic/48344-str-replace-problems/#findComment-236447 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.