I've been searching google for about the last hour now and have yet to find an answer to my problem.
Basically, using PHP, I need to be able to open a specific local file, search that file for a specific string/function, input/write dynamically generated code from an input to a specific line based on the location of the found string/function.
I know this might seem confusing, but the end result is a controlled user being able to add an additional case/if type function to existing ones in a file. It will have to happen in multiple files, but the base idea remains the same.
I've looked at using fopen/fwrite but i haven't found a solid answer that would suit my needs.
Thanks in advance for your help.