almightyegg Posted January 27, 2008 Share Posted January 27, 2008 On my files I always used to use sessions but then changed to COOKIES. All of a sudden where ever I have left a session_start it shows an error which it hadn't previously done... Anyways! Rather than going through each of the 100s of files 1 by 1 I was wondering if it's possible to write a script that deletes Session_start from any file that is in my directory?? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/88096-mass-replace/ Share on other sites More sharing options...
clown[NOR] Posted January 27, 2008 Share Posted January 27, 2008 what program are you using? if you use Dreamweaver you can do a search and replace... just type "seesion_start" as the search word and leave the replace box empty. that will go trough the whole file and replace every session_start it can find Quote Link to comment https://forums.phpfreaks.com/topic/88096-mass-replace/#findComment-450715 Share on other sites More sharing options...
almightyegg Posted January 27, 2008 Author Share Posted January 27, 2008 No I'm using Notepad - is there no way to do it with pure PHP? Quote Link to comment https://forums.phpfreaks.com/topic/88096-mass-replace/#findComment-450717 Share on other sites More sharing options...
clown[NOR] Posted January 27, 2008 Share Posted January 27, 2008 i think if you go to Edit > Replace and do the same steps there like i explained for DW Quote Link to comment https://forums.phpfreaks.com/topic/88096-mass-replace/#findComment-450719 Share on other sites More sharing options...
almightyegg Posted January 27, 2008 Author Share Posted January 27, 2008 Yes it does, but it still means I have to open 200+ files to do it Quote Link to comment https://forums.phpfreaks.com/topic/88096-mass-replace/#findComment-450724 Share on other sites More sharing options...
resago Posted January 27, 2008 Share Posted January 27, 2008 glob *.php run through the array, open each file into a string do a string or preg replace /s write the string back to the file. Quote Link to comment https://forums.phpfreaks.com/topic/88096-mass-replace/#findComment-450726 Share on other sites More sharing options...
clown[NOR] Posted January 27, 2008 Share Posted January 27, 2008 yeah you could do something like resago said.. make a file called something like "rem_session_start.php" in it you make a script that opens every php file and replaces "session_start" with a blank space or something Quote Link to comment https://forums.phpfreaks.com/topic/88096-mass-replace/#findComment-450732 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.