Jump to content

Recommended Posts

Hey phpfreaks!

 

I have a bit of PHP code that defines a few strings then I want that strings to replace an old part of code from a different HTML file called sidebar.htm. I need to delete the old code that is there, then add in the new code(a string called $sbar) in the correct spot.

 

I could find the start of what I wanted deleted by the position (734 characters) because the code before it is always the same. The ending character of what needs to be deleted will vary. Therefore I need a way of reconizing the next </p> in the code AFTER the start position. I think that would be the easiest way. Correct me if i'm wrong.

 

Then I need to insert the string (which is called $sbar and is html code) in to that space in that file at 734 characters.

 

 

 

Hope someone can help me ASAP! If you need any other information to help me out, please ask.

 

Thanks in advance,

Josh

Link to comment
https://forums.phpfreaks.com/topic/69622-inserting-and-deleteing-into-other-file/
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.