I am needing to replace a whole line of code in a file with a new line of code. This is what I need to do.
I need to replace.
$db_url = 'mysql://test_dev:test12@localhost/test';
$db_url = 'mysql://$dbuser:$dbpass@localhost/$dbase';
OK this is where it gets complicated. The first $db_url = line is not allways going to be set to test_dev:test12 etc... I need to be able to find the $db_url line and replace it with the second line. I hope this makes sence. Its just alot safer if I can replace the whole line.
Yes the $dbuser, $dbpass, $dbase are variables I am using in my script.
So any help would be appretiated.