I have a string with this format:
$something = $gateway->execute($query) or die(mysql_error() . " here");
$id = mysql_insert_id();
This is tricky, because I want to end up with this:
$id = $gateway->execute($query) or die(mysql_error() . " here");
I've tried matching the mysql_insert_id line, then looking behind for $gateway->execute and replacing $something with the captured $id, but I coudln't figure it out. Is this even possible? I also want to delete the mysql_insert_id line, but I could always grep and replace afterwards and replace with empty string.
Thanks.