Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.