royalf Posted September 17, 2007 Share Posted September 17, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/69622-inserting-and-deleteing-into-other-file/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.