OM2 Posted July 17, 2013 Share Posted July 17, 2013 I will have a PHP file Within that PHP file I'll have something like this: <!-- #### Start of my code --> <!-- #### End of my code --> I want to write code that replaces everything between those 2 delimeters in the file I'm just not sure where to start with the pattern matching - seems so complex to me right now I'd like to make water tight as possible - I want to have several of these in the same file Any code to help me start would be great Thanks OM Link to comment https://forums.phpfreaks.com/topic/280221-need-help-opening-up-a-file-and-replacing-text-between-2-delimiters/ Share on other sites More sharing options...
Muddy_Funster Posted July 17, 2013 Share Posted July 17, 2013 lookup the following on the manual website : file_get_contents(), substrpos() and substr_replace() - they should get you going along the right lines. Link to comment https://forums.phpfreaks.com/topic/280221-need-help-opening-up-a-file-and-replacing-text-between-2-delimiters/#findComment-1441063 Share on other sites More sharing options...
OM2 Posted July 30, 2013 Author Share Posted July 30, 2013 @Muddy_Funster, thanks for the reply. i didn't realise i had a reply - didn't get email notification i'll give that a go and will post back Link to comment https://forums.phpfreaks.com/topic/280221-need-help-opening-up-a-file-and-replacing-text-between-2-delimiters/#findComment-1442711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.