Record string to file on PHP

This script is looking for a specific string and changes it to the desired one, and how to make a certain line, but the next one, which goes after it?

Answer 1, Authority 100%

array_splice($fopen, $key, 1, $what);

Replace on:

        array_splice($fopen, $key+1, 1, $what); 

p.s. Use the next time, format text code. And it is unreal to read.