Alas, using the features of bash is very difficult to implement.
but you can use other programs from the operating system. for example, the find (for search) and sed (for changing the contents of the file) programs will greatly help.
in any php files in all subfolders of the current folder
$ find -type f -name \*.php
replace it with another piece of code
as I understand it, the initial and final lines are given, and everything between these lines (including these lines themselves) must be replaced with some text:
$ sed -i '/начальная строка/,/конечная строка/c\какой-то текст' файл
it remains only to “join” these two programs together so that the second receives a list of files from the first. for this you can use, for example, the xargs program:
$ find опции.и.параметры | xargs sed опции.и.параметры
or, for your particular case:
$ find -type f -name \*.php | xargs sed -i '/<div class="site-info">/,/<\/div><!-- .site-info -->/c\какой-то текст'
additional reading:
$ man find $ man sed $ man xargs