Jump to content

Inserting and deleteing into other file.


royalf

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.