I'm trying to build an installation script for a tool. It needs to open a PHP file, locate a specific line and insert multiple lines BEFORE the located line.
How would I do that? The line I need to find looks like this:
$smarty->assign(array(
'products' =>
Note: 2 tabs before $smarty and a CR/LF after array( and 3 tabs before 'products' =>
I've tried getting the file contents in a string and replacing it but it doesn't replace it at all.